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 1sGM0r-00C6ne-Vn for pgsql-bugs@arkaria.postgresql.org; Sun, 09 Jun 2024 17:07:26 +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 1sGLzs-005A6z-6r for pgsql-bugs@arkaria.postgresql.org; Sun, 09 Jun 2024 17:06:25 +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 1sGLzr-005A6q-Un for pgsql-bugs@lists.postgresql.org; Sun, 09 Jun 2024 17:06:24 +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 1sGLzq-000niP-W5 for pgsql-bugs@lists.postgresql.org; Sun, 09 Jun 2024 17:06:24 +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 459H6Krn541708; Sun, 9 Jun 2024 13:06:20 -0400 From: Tom Lane To: =?UTF-8?Q?Vedran_Bilopavlovi=C4=87?= cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG: value in information_schema.parameters.parameter_default is always NULL for roles t In-reply-to: References: Comments: In-reply-to =?UTF-8?Q?Vedran_Bilopavlovi=C4=87?= message dated "Sun, 09 Jun 2024 12:44:14 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <541706.1717952780.1@sss.pgh.pa.us> Date: Sun, 09 Jun 2024 13:06:20 -0400 Message-ID: <541707.1717952780@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk =?UTF-8?Q?Vedran_Bilopavlovi=C4=87?= writes: > Values in table *information_schema.parameters*, column *parameter_default*, > are always NULL only for roles that are not superuser. I see no bug there. The manual defines parameter_default as The default expression of the parameter, or null if none or if the function is not owned by a currently enabled role. A superuser is considered to own everything, but for mere-mortal roles a result would only appear for functions you own. The SQL implementation of the view appears to match this definition: CASE WHEN pg_has_role(proowner, 'USAGE') THEN pg_get_function_arg_default(p_oid, (ss.x).n) ELSE NULL END You could certainly quibble with the value of hiding the information when it's readily available from our system catalogs --- but this is a SQL-standard-defined view so we implement it as the standard says, and this is what the standard says it should do. > There is a workaround by using pg_proc table: I'd recommend using something from the pg_get_function*() family. regards, tom lane