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

Fix trigger failure with FK reference on table variables/temp tables #522

Conversation

roshan0708
Copy link
Contributor

@roshan0708 roshan0708 commented Jan 30, 2025

Description

Resolve issue where triggers referencing foreign keys fail with "relation does not exist" error when dealing with table variables or temporary tables. This fix ensures proper handling of search paths and query revalidation in the context of triggers.

Additionally, optimize dialect setting by directly using assign_sql_dialect function instead of set_config_option in the RUN_AS_PSQL macro, reducing overhead in dialect switching operations.

Extension PR: babelfish-for-postgresql/babelfish_extensions#3440

Issues Resolved

Task: BABEL-5270

Check List

  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is under the terms of the PostgreSQL license, and grant any person obtaining a copy of the contribution permission to relicense all or a portion of my contribution to the PostgreSQL License solely to contribute all or a portion of my contribution to the PostgreSQL open source project.

For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Resolve issue where triggers referencing foreign keys fail with
"relation does not exist" error when dealing with table variables
or temporary tables. This fix ensures proper handling of search
paths and query revalidation in the context of triggers.

Additionally, optimize dialect setting by directly using
assign_sql_dialect function instead of set_config_option in the
RUN_AS_PSQL macro, reducing overhead in dialect switching operations.

Task: BABEL-5270
Signed-off-by: Roshan Kanwar <[email protected]>
src/backend/utils/adt/ri_triggers.c Show resolved Hide resolved
.github/workflows/main.yml Outdated Show resolved Hide resolved
src/backend/utils/adt/ri_triggers.c Show resolved Hide resolved
src/backend/utils/adt/ri_triggers.c Show resolved Hide resolved
src/backend/utils/adt/ri_triggers.c Show resolved Hide resolved
src/backend/utils/adt/ri_triggers.c Show resolved Hide resolved
src/backend/utils/adt/ri_triggers.c Show resolved Hide resolved
src/backend/utils/adt/ri_triggers.c Show resolved Hide resolved
src/backend/utils/adt/ri_triggers.c Outdated Show resolved Hide resolved
.github/workflows/main.yml Outdated Show resolved Hide resolved
src/backend/utils/adt/ri_triggers.c Show resolved Hide resolved
src/backend/utils/adt/ri_triggers.c Outdated Show resolved Hide resolved
src/backend/utils/adt/ri_triggers.c Show resolved Hide resolved
src/backend/utils/adt/ri_triggers.c Outdated Show resolved Hide resolved
@Deepesh125 Deepesh125 merged commit 34e5098 into babelfish-for-postgresql:BABEL_5_X_DEV__PG_17_X Feb 7, 2025
2 checks passed
@Deepesh125 Deepesh125 deleted the JIRA-BABEL-5270 branch February 7, 2025 05:43
roshan0708 added a commit to amazon-aurora/postgresql_modified_for_babelfish that referenced this pull request Feb 7, 2025
…abelfish-for-postgresql#522)

Resolve issue where triggers referencing foreign keys fail with
"relation does not exist" error when dealing with table variables
or temporary tables. This fix ensures proper handling of search
paths and query revalidation in the context of triggers.

Additionally, optimize dialect setting by directly using
assign_sql_dialect function instead of set_config_option in the
RUN_AS_PSQL macro, reducing overhead in dialect switching operations.

Task: BABEL-5270
Signed-off-by: Roshan Kanwar <[email protected]>
(cherry picked from commit 34e5098)
shardgupta pushed a commit that referenced this pull request Feb 7, 2025
…522) (#530)

Resolve issue where triggers referencing foreign keys fail with
"relation does not exist" error when dealing with table variables
or temporary tables. This fix ensures proper handling of search
paths and query revalidation in the context of triggers.

Additionally, optimize dialect setting by directly using
assign_sql_dialect function instead of set_config_option in the
RUN_AS_PSQL macro, reducing overhead in dialect switching operations.

Task: BABEL-5270
Signed-off-by: Roshan Kanwar <[email protected]>
(cherry picked from commit 34e5098)
roshan0708 added a commit to amazon-aurora/postgresql_modified_for_babelfish that referenced this pull request Feb 7, 2025
…abelfish-for-postgresql#522)

Resolve issue where triggers referencing foreign keys fail with
"relation does not exist" error when dealing with table variables
or temporary tables. This fix ensures proper handling of search
paths and query revalidation in the context of triggers.

Additionally, optimize dialect setting by directly using
assign_sql_dialect function instead of set_config_option in the
RUN_AS_PSQL macro, reducing overhead in dialect switching operations.

Task: BABEL-5270
Signed-off-by: Roshan Kanwar <[email protected]>
(cherry picked from commit 34e5098)
roshan0708 added a commit to amazon-aurora/postgresql_modified_for_babelfish that referenced this pull request Feb 7, 2025
…abelfish-for-postgresql#522) (babelfish-for-postgresql#530)

Resolve issue where triggers referencing foreign keys fail with
"relation does not exist" error when dealing with table variables
or temporary tables. This fix ensures proper handling of search
paths and query revalidation in the context of triggers.

Additionally, optimize dialect setting by directly using
assign_sql_dialect function instead of set_config_option in the
RUN_AS_PSQL macro, reducing overhead in dialect switching operations.

Task: BABEL-5270
Signed-off-by: Roshan Kanwar <[email protected]>
(cherry picked from commit 34e5098)
(cherry picked from commit ba81846)
rishabhtanwar29 pushed a commit that referenced this pull request Feb 7, 2025
…522) (#530) (#532)

Resolve issue where triggers referencing foreign keys fail with
"relation does not exist" error when dealing with table variables
or temporary tables. This fix ensures proper handling of search
paths and query revalidation in the context of triggers.

Additionally, optimize dialect setting by directly using
assign_sql_dialect function instead of set_config_option in the
RUN_AS_PSQL macro, reducing overhead in dialect switching operations.

Task: BABEL-5270
Signed-off-by: Roshan Kanwar <[email protected]>
rishabhtanwar29 pushed a commit that referenced this pull request Feb 7, 2025
…522) (#531)

Resolve issue where triggers referencing foreign keys fail with
"relation does not exist" error when dealing with table variables
or temporary tables. This fix ensures proper handling of search
paths and query revalidation in the context of triggers.

Additionally, optimize dialect setting by directly using
assign_sql_dialect function instead of set_config_option in the
RUN_AS_PSQL macro, reducing overhead in dialect switching operations.

Task: BABEL-5270
Signed-off-by: Roshan Kanwar <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants