Skip to content

Commit

Permalink
Allow superuser to ALTER OWNER of datatype functions (#251)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamguo0 authored Dec 1, 2023
1 parent 93ef5bf commit 6bad5a6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/tleextension.c
Original file line number Diff line number Diff line change
Expand Up @@ -4315,7 +4315,9 @@ _PU_HOOK
{
AlterOwnerStmt *stmt = (AlterOwnerStmt *) pu_parsetree;

if (!IsBinaryUpgrade && stmt->objectType == OBJECT_FUNCTION)
if (!IsBinaryUpgrade &&
!superuser() &&
stmt->objectType == OBJECT_FUNCTION)
{
ObjectAddress address;
Relation relation;
Expand Down
2 changes: 1 addition & 1 deletion test/t/002_pg_tle_dump_restore.pl
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@

# Restore freshly created db with psql -d newdb -f olddb.sql
$node->command_ok(
[ 'psql', '-d', $restored_db, '-f', $dumpfilename ],
[ 'psql', '-d', $restored_db, '-f', $dumpfilename, '-v', 'ON_ERROR_STOP=1' ],
'restore new db from sql dump'
);

Expand Down

0 comments on commit 6bad5a6

Please sign in to comment.