Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[YSQL] Foreign Key support for INSERT ON CONFLICT #24649

Closed
1 task done
karthik-ramanathan-3006 opened this issue Oct 28, 2024 · 0 comments
Closed
1 task done

[YSQL] Foreign Key support for INSERT ON CONFLICT #24649

karthik-ramanathan-3006 opened this issue Oct 28, 2024 · 0 comments
Assignees
Labels
area/ysql Yugabyte SQL (YSQL) kind/enhancement This is an enhancement of an existing feature priority/medium Medium priority issue status/awaiting-triage Issue awaiting triage

Comments

@karthik-ramanathan-3006
Copy link
Contributor

karthik-ramanathan-3006 commented Oct 28, 2024

Jira Link: DB-13713

Description

a000dbb introduced batching support for the INSERT ... ON CONFLICT queries on relations that did not:

  • Reference other relations via a foreign key relationship
  • Have other relations referencing it via a foreign key relationship

This issue seeks to add batching support for INSERT ... ON CONFLICT queries on relations that have foreign keys.
More details to follow.

Issue Type

kind/enhancement

Warning: Please confirm that this issue does not contain any sensitive information

  • I confirm this issue does not contain any sensitive information.
@karthik-ramanathan-3006 karthik-ramanathan-3006 added area/ysql Yugabyte SQL (YSQL) status/awaiting-triage Issue awaiting triage labels Oct 28, 2024
@yugabyte-ci yugabyte-ci added kind/enhancement This is an enhancement of an existing feature priority/medium Medium priority issue labels Oct 28, 2024
jasonyb pushed a commit that referenced this issue Jan 30, 2025
…r FK

Summary:
Previously, the presence of after row insert triggers prevented INSERT
ON CONFLICT read batching.  Loosen this restriction to allow for after
row insert triggers as long as they are for foreign key constraint
checking.  No further code changes should be needed because the current
design is sufficient.  Foreign key constraints are checked at the end of
the _statement_ or _transaction_, making them easy to reason with when
it comes to batching.
Jira: DB-13713

Test Plan:
On Almalinux 8:

    #!/usr/bin/env bash
    set -euo pipefail
    ./yb_build.sh fastdebug --gcc11
    find java/yb-pgsql/src/test/java/org/yb/pgsql -name 'TestPgRegressInsertOnConflict*' \
    | grep -oE 'TestPgRegress\w+' \
    | while read -r testname; do
      ./yb_build.sh fastdebug --gcc11 --java-test "$testname" --sj
    done

Close: #24649
Original commit: 16f2042 / D41108

Reviewers: kramanathan

Reviewed By: kramanathan

Differential Revision: https://phorge.dev.yugabyte.com/D41596
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ysql Yugabyte SQL (YSQL) kind/enhancement This is an enhancement of an existing feature priority/medium Medium priority issue status/awaiting-triage Issue awaiting triage
Projects
None yet
Development

No branches or pull requests

2 participants