PG16: Refactored ownercheck functions #6242
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In our code we have an Event Trigger on
ddl_command_end
to process some DDL commands, and specially theALTER TABLE
we execute some code to properly deal with hypertables, chunks and compressed chunks.The problem is when we start to process our code at
ddl_command_end
event we get the relatedrelid
by calling theAlterTableLookupRelation
that perform the proper acl checking. But this is a bit wrong because in case of aALTER TABLE ... OWNER TO ...
at this point (akaddl_command_end
) the ownership of the relation was already processed and with this PG16 refactoring it now is visible for theobject_ownercheck
leading to a misbehavior.Due to our intention is just the get the
relid
related to the AlterTableCmd just fixed it by replacing theAlterTableLookupRelation
for theRangeVarGetRelid
because at this point all the proper aclcheck was already done.postgres/postgres@afbfc029
Disable-check: force-changelog-file