Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sJg4F-006Ayu-Se for pgsql-admin@arkaria.postgresql.org; Tue, 18 Jun 2024 21:08:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sJg4C-003XYc-Md for pgsql-admin@arkaria.postgresql.org; Tue, 18 Jun 2024 21:08:37 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sJg4C-003XYU-BV for pgsql-admin@lists.postgresql.org; Tue, 18 Jun 2024 21:08:37 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sJg4A-002LWe-R0 for pgsql-admin@lists.postgresql.org; Tue, 18 Jun 2024 21:08:36 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 45IL8VXr4191920; Tue, 18 Jun 2024 17:08:31 -0400 From: Tom Lane To: "David G. Johnston" cc: PABLO ANDRES IBARRA DUPRAT , "pgsql-admin@lists.postgresql.org" Subject: Re: Scripting a ALTER PROCEDURE or FUNCTION to Change OWNER In-reply-to: References: Comments: In-reply-to "David G. Johnston" message dated "Tue, 18 Jun 2024 14:02:08 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <4191918.1718744911.1@sss.pgh.pa.us> Date: Tue, 18 Jun 2024 17:08:31 -0400 Message-ID: <4191919.1718744911@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "David G. Johnston" 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