- Notifications
You must be signed in to change notification settings - Fork67
[PGPRO-5255] fix that ALTER TABLE IF EXISTS ... RENAME TO of not exis…#228
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
…ted table generate ERROR instead of NOTICE
src/utility_stmt_hooking.c Outdated
@@ -175,7 +175,10 @@ is_pathman_related_table_rename(Node *parsetree, | |||
/* Fetch Oid of this relation */ | |||
relation_oid = RangeVarGetRelid(rename_stmt->relation, | |||
AccessShareLock, | |||
false); | |||
rename_stmt->missing_ok); | |||
/* PGPRO-5255: check ALTER TABLE IF EXISTS of non existent table */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Probably, I'd not use problem numbers here. Otherwise all the code would look like this in near future. Just simple description why this code is here would be enough.
sql/pathman_utility_stmt.sql Outdated
* Test, that ALTER TABLE IF EXISTS ... RENAME TO of not existed table generate NOTICE instead of ERROR | ||
*/ | ||
CREATE SCHEMA rename_nonexistent; | ||
ALTER TABLE IF EXISTS rename_nonexistent.nonexistent_table RENAME TO other_table_name; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Maybe add some more cases here?
ALTER TABLE IF EXISTS foo SET SCHEMA baz;ALTER TABLE IF EXISTS foo RENAME COLUMN baz TO bar;DROP TABLE IF EXISTS foo;```
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
That looks good for me.
…ted table generate ERROR instead of NOTICE