HEAD \df doesn't show functions with no arguments

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: pgsql-hackers(at)postgresql(dot)org
Subject: HEAD \df doesn't show functions with no arguments
Date: 2005-03-31 05:49:08
Message-ID: 20050331054908.GA39424@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

In HEAD psql, \df doesn't show functions that have no arguments:

test=> CREATE FUNCTION foo() RETURNS integer AS 'SELECT 1' LANGUAGE sql;
CREATE FUNCTION
test=> \df foo
List of functions
Schema | Name | Result data type | Argument data types
--------+------+------------------+---------------------
(0 rows)

The problem appears to be that proargtypes[0] is now NULL instead
of 0. Here's a simplified version of the \df query:

SELECT proname
FROM pg_catalog.pg_proc p
WHERE p.proargtypes[0] <> 'pg_catalog.cstring'::pg_catalog.regtype
AND p.proname ~ '^foo$';
proname
---------
(0 rows)

SELECT proargtypes[0], proargtypes[0] IS NULL
FROM pg_proc
WHERE proname = 'foo';
proargtypes | ?column?
-------------+----------
| t
(1 row)

Here's the latter query in 8.0.2beta1:

proargtypes | ?column?
-------------+----------
0 | f
(1 row)

I'm not sure when this broke -- perhaps with the recent oidvector
changes?

http://archives.postgresql.org/pgsql-committers/2005-03/msg00423.php

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2005-03-31 06:06:39 Re: HEAD \df doesn't show functions with no arguments
Previous Message Tom Lane 2005-03-31 05:19:08 Re: Notes on lock table spilling

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2005-03-31 06:06:39 Re: HEAD \df doesn't show functions with no arguments
Previous Message Mark Kirkwood 2005-03-31 04:52:27 Re: [HACKERS] contrib/pg_buffercache