pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedpg_catalog.pg_proc procedure has correct proargnames array, but proargtypes is empty
6+ messages / 3 participants
[nested] [flat]
* pg_catalog.pg_proc procedure has correct proargnames array, but proargtypes is empty
@ 2022-07-15 23:37 Walker Philips <wphilips53@gmail.com>
0 siblings, 2 replies; 6+ messages in thread
From: Walker Philips @ 2022-07-15 23:37 UTC (permalink / raw)
To: pgsql-bugs@lists.postgresql.org
The following function's metadata is not correctly reported in the pg_proc
table (see picture below).
CREATE OR REPLACE FUNCTION scm.get_period_type_adjustment(period_type_id
integer)
RETURNS numeric
LANGUAGE plpgsql
IMMUTABLE
AS $function$
------
begin
return (case
when period_type_id in (1) then 1.0
when period_type_id in (2, 17, 4, 3) then 0.25
when period_type_id = 10 then 0.5
else 1
end)::numeric;
end;
$function$
;
[image: image.png]
--
Walker Philips
Data Engineering Consultant
Saguaro Capital Management
Attachments:
image.png (image/png, 36.1K) download
view image
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: pg_catalog.pg_proc procedure has correct proargnames array, but proargtypes is empty
@ 2022-07-16 00:41 David Rowley <dgrowleyml@gmail.com>
parent: Walker Philips <wphilips53@gmail.com>
1 sibling, 1 reply; 6+ messages in thread
From: David Rowley @ 2022-07-16 00:41 UTC (permalink / raw)
To: Walker Philips <wphilips53@gmail.com>; +Cc: PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
On Sat, 16 Jul 2022 at 12:14, Walker Philips <wphilips53@gmail.com> wrote:
> The following function's metadata is not correctly reported in the pg_proc table (see picture below).
Seems quite unlikely this such a fundamental thing could be broken.
Can you share which version of PostgreSQL you see this on?
I see the proargtypes populated properly on current master.
David
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: pg_catalog.pg_proc procedure has correct proargnames array, but proargtypes is empty
@ 2022-07-16 00:45 Tom Lane <tgl@sss.pgh.pa.us>
parent: Walker Philips <wphilips53@gmail.com>
1 sibling, 0 replies; 6+ messages in thread
From: Tom Lane @ 2022-07-16 00:45 UTC (permalink / raw)
To: Walker Philips <wphilips53@gmail.com>; +Cc: pgsql-bugs@lists.postgresql.org
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
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: pg_catalog.pg_proc procedure has correct proargnames array, but proargtypes is empty
@ 2022-07-16 00:54 Tom Lane <tgl@sss.pgh.pa.us>
parent: David Rowley <dgrowleyml@gmail.com>
0 siblings, 1 reply; 6+ messages in thread
From: Tom Lane @ 2022-07-16 00:54 UTC (permalink / raw)
To: David Rowley <dgrowleyml@gmail.com>; +Cc: Walker Philips <wphilips53@gmail.com>; PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
David Rowley <dgrowleyml@gmail.com> writes:
> Can you share which version of PostgreSQL you see this on?
Hmm ... looking more closely, it's definitely not stock PG,
because proargtypes is oidvector which would not include any
curly braces in the output.
Hard to tell what's going on exactly; seems like it could be
corrupt catalog data or faulty code modifications. Or maybe
there's something wrong with whatever the viewing tool is?
regards, tom lane
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: pg_catalog.pg_proc procedure has correct proargnames array, but proargtypes is empty
@ 2022-07-16 21:20 Walker Philips <wphilips53@gmail.com>
parent: Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 6+ messages in thread
From: Walker Philips @ 2022-07-16 21:20 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; dgrowleyml@gmail.com; pgsql-bugs@lists.postgresql.org
PostgreSQL 14.4 (Ubuntu 14.4-1.pgdg22.04+1) on x86_64-pc-linux-gnu,
compiled by gcc (Ubuntu 11.2.0-19ubuntu1) 11.2.0, 64-bit
I'm using DBeaver as my IDE. The column does appear to be oidvector. Other
functions seem to come through ok weirdly enough. It potentially might be a
visual glitch with DBeaver based on the following screenshot. Still pretty
odd. I can submit to DBeaver if that might be the underlying issue.
[image: image.png]
[image: image.png]
On Fri, Jul 15, 2022 at 7:54 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> David Rowley <dgrowleyml@gmail.com> writes:
> > Can you share which version of PostgreSQL you see this on?
>
> Hmm ... looking more closely, it's definitely not stock PG,
> because proargtypes is oidvector which would not include any
> curly braces in the output.
>
> Hard to tell what's going on exactly; seems like it could be
> corrupt catalog data or faulty code modifications. Or maybe
> there's something wrong with whatever the viewing tool is?
>
> regards, tom lane
>
--
Walker Philips
Data Engineering Consultant
Saguaro Capital Management
Attachments:
image.png (image/png, 30.6K) download
view image
image.png (image/png, 31.5K) download
view image
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: pg_catalog.pg_proc procedure has correct proargnames array, but proargtypes is empty
@ 2022-07-16 23:07 Tom Lane <tgl@sss.pgh.pa.us>
parent: Walker Philips <wphilips53@gmail.com>
0 siblings, 0 replies; 6+ messages in thread
From: Tom Lane @ 2022-07-16 23:07 UTC (permalink / raw)
To: Walker Philips <wphilips53@gmail.com>; +Cc: dgrowleyml@gmail.com; pgsql-bugs@lists.postgresql.org
Walker Philips <wphilips53@gmail.com> writes:
> I'm using DBeaver as my IDE. The column does appear to be oidvector. Other
> functions seem to come through ok weirdly enough. It potentially might be a
> visual glitch with DBeaver based on the following screenshot. Still pretty
> odd. I can submit to DBeaver if that might be the underlying issue.
I'd try looking at the row in psql. If it looks normal there,
then it's a DBeaver problem.
regards, tom lane
^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2022-07-16 23:07 UTC | newest]
Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-07-15 23:37 pg_catalog.pg_proc procedure has correct proargnames array, but proargtypes is empty Walker Philips <wphilips53@gmail.com>
2022-07-16 00:41 ` David Rowley <dgrowleyml@gmail.com>
2022-07-16 00:54 ` Tom Lane <tgl@sss.pgh.pa.us>
2022-07-16 21:20 ` Walker Philips <wphilips53@gmail.com>
2022-07-16 23:07 ` Tom Lane <tgl@sss.pgh.pa.us>
2022-07-16 00:45 ` Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox