Re: pg_catalog.pg_proc procedure has correct proargnames array, but proargtypes is empty - Mailing list pgsql-bugs

From Tom Lane
Subject Re: pg_catalog.pg_proc procedure has correct proargnames array, but proargtypes is empty
Date
Msg-id 3546148.1657932327@sss.pgh.pa.us
Whole thread Raw
In response to pg_catalog.pg_proc procedure has correct proargnames array, but proargtypes is empty  (Walker Philips <wphilips53@gmail.com>)
List pgsql-bugs
Walker Philips <wphilips53@gmail.com> writes:
> The following function's metadata is not correctly reported in the pg_proc
> table (see picture below).

Looks fine to me:

regression=# CREATE OR REPLACE FUNCTION get_period_type_adjustment(period_type_id
integer)
 RETURNS numeric
...
regression=# \x
Expanded display is on.
regression=# select * from pg_proc where proname = 'get_period_type_adjustment';
...
pronargs        | 1
pronargdefaults | 0
prorettype      | 1700
proargtypes     | 23
proallargtypes  |
proargmodes     |
proargnames     | {period_type_id}
proargdefaults  |
...

One IN integer argument named period_type_id, result type numeric.

Note the comments in

https://www.postgresql.org/docs/devel/catalog-pg-proc.html

that proallargtypes etc. are generally set to NULL if they wouldn't
carry any additional data.  This is a choice we made a long time
ago to prioritize storage space over simplicity of implementation.
I don't know whether we'd make the same choice in a green field
today ... but we're not going to change it now, because the ensuing
confusion would be pretty bad.

            regards, tom lane



pgsql-bugs by date:

Previous
From: David Rowley
Date:
Subject: Re: pg_catalog.pg_proc procedure has correct proargnames array, but proargtypes is empty
Next
From: Tom Lane
Date:
Subject: Re: pg_catalog.pg_proc procedure has correct proargnames array, but proargtypes is empty