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

Cross-db insert on table with identity throws permission error on inserting in identity column #3437

Conversation

thephantomthief
Copy link
Contributor

Previously, INSERTs on identity columns would throw permission denied on sequence error if the relation name is referenced as a three part object name and the database name in the qualified object name is not the current database name. To fix this, when we are about to proceed with the identity insert, we will first identify it is a cross database scenario. If it is, we will change the current role as the session user.

Task: BABEL-5585
Signed-off-by: Sharu Goel [email protected]

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 Apache 2.0 and PostgreSQL licenses, 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.

…erting in identity column

Previously, INSERTs on identity columns would throw permission denied on
sequence error if the relation name is referenced as a three part object
name and the database name in the qualified object name is not the
current database name. To fix this, when we are about to proceed with
the identity insert, we will first identify it is a cross database
scenario. If it is, we will change the current role as the session user.

Task: BABEL-5585
Signed-off-by: Sharu Goel <[email protected]>
@coveralls
Copy link
Collaborator

Pull Request Test Coverage Report for Build 13031501521

Details

  • 19 of 22 (86.36%) changed or added relevant lines in 2 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.007%) to 74.949%

Changes Missing Coverage Covered Lines Changed/Added Lines %
contrib/babelfishpg_tsql/src/pl_handler.c 0 1 0.0%
contrib/babelfishpg_tsql/src/pl_exec.c 19 21 90.48%
Files with Coverage Reduction New Missed Lines %
contrib/babelfishpg_tsql/src/pl_handler.c 1 90.05%
Totals Coverage Status
Change from base Build 12925064866: 0.007%
Covered Lines: 47011
Relevant Lines: 62724

💛 - Coveralls

@shardgupta shardgupta merged commit 11c3287 into babelfish-for-postgresql:BABEL_4_X_DEV Jan 30, 2025
47 checks passed
@shardgupta shardgupta deleted the sharu-dev-babel-5585-4x branch January 30, 2025 08:23
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.

3 participants