Skip to content

Commit 6bad5a6

Browse files
authored
Allow superuser to ALTER OWNER of datatype functions (#251)
1 parent 93ef5bf commit 6bad5a6

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/tleextension.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4315,7 +4315,9 @@ _PU_HOOK
43154315
{
43164316
AlterOwnerStmt *stmt = (AlterOwnerStmt *) pu_parsetree;
43174317

4318-
if (!IsBinaryUpgrade && stmt->objectType == OBJECT_FUNCTION)
4318+
if (!IsBinaryUpgrade &&
4319+
!superuser() &&
4320+
stmt->objectType == OBJECT_FUNCTION)
43194321
{
43204322
ObjectAddress address;
43214323
Relation relation;

test/t/002_pg_tle_dump_restore.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@
298298

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

0 commit comments

Comments
 (0)