Re: Scripting a ALTER PROCEDURE or FUNCTION to Change OWNER

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: PABLO ANDRES IBARRA DUPRAT <Pablo(dot)Ibarra(at)itau(dot)cl>, "pgsql-admin(at)lists(dot)postgresql(dot)org" <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: Re: Scripting a ALTER PROCEDURE or FUNCTION to Change OWNER
Date: 2024-06-18 21:08:31
Message-ID: 4191919.1718744911@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

"David G. Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> writes:
> Specifically:

> select id.*, pg_proc.*, tableoid from pg_proc,
> pg_identify_object(1255,oid,0) as id;

Personally, I'd cast the procedure's OID to regprocedure instead.
More or less the same output, doesn't require magic numbers.

(Although I think you could write "pg_proc.tableoid" instead
of "1255", if you're intent on using pg_identify_object.)

regards, tom lane

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message PABLO ANDRES IBARRA DUPRAT 2024-06-18 21:14:09 RE: Scripting a ALTER PROCEDURE or FUNCTION to Change OWNER
Previous Message David G. Johnston 2024-06-18 21:02:08 Re: Scripting a ALTER PROCEDURE or FUNCTION to Change OWNER