Unix Technical Forum

Re: [HACKERS] HEAD \df doesn't show functions with no arguments

This is a discussion on Re: [HACKERS] HEAD \df doesn't show functions with no arguments within the Pgsql Patches forums, part of the PostgreSQL category; --> I have applied the following attached patch to CVS to fix the \df display problem you reported. We might ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql Patches

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-18-2008, 12:12 AM
Bruce Momjian
 
Posts: n/a
Default Re: [HACKERS] HEAD \df doesn't show functions with no arguments


I have applied the following attached patch to CVS to fix the \df
display problem you reported. We might remove the test it at some point
but at least now it works as in previous releases.

---------------------------------------------------------------------------

Michael Fuhr wrote:
> On Thu, Mar 31, 2005 at 01:06:39AM -0500, Tom Lane wrote:
> > Michael Fuhr <mike@fuhr.org> writes:
> > > 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':g_catalog.regtype
> > > AND p.proname ~ '^foo$';

> >
> > We could fix it by changing <> to IS DISTINCT FROM ... but I've never
> > been very happy with the idea that \df tries to suppress I/O functions
> > anyway. How do you feel about removing the cstring test altogether?

>
> Wouldn't bother me -- I'd rather see what's there and make the
> "uninteresting" call myself, if that's the only reason for not
> showing the I/O functions. It's not like they'd overwhelm the
> output.
>
> CREATE DATABASE foo TEMPLATE = template0;
> \c foo
>
> SELECT count(*) FROM pg_proc WHERE proargtypes[0] = 'cstring'::regtype;
> count
> -------
> 63
> (1 row)
>
> SELECT count(*) FROM pg_proc;
> count
> -------
> 1760
> (1 row)
>
> --
> Michael Fuhr
> http://www.fuhr.org/~mfuhr/
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
>


--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

Index: src/bin/psql/describe.c
================================================== =================
RCS file: /cvsroot/pgsql/src/bin/psql/describe.c,v
retrieving revision 1.113
diff -c -c -r1.113 describe.c
*** src/bin/psql/describe.c 16 Mar 2005 23:52:18 -0000 1.113
--- src/bin/psql/describe.c 1 Apr 2005 03:43:20 -0000
***************
*** 201,207 ****
*/
appendPQExpBuffer(&buf,
"WHERE p.prorettype <> 'pg_catalog.cstring':g_catalog.regtype\n"
! " AND p.proargtypes[0] <> 'pg_catalog.cstring':g_catalog.regtype\n"
" AND NOT p.proisagg\n");

processNamePattern(&buf, pattern, true, false,
--- 201,208 ----
*/
appendPQExpBuffer(&buf,
"WHERE p.prorettype <> 'pg_catalog.cstring':g_catalog.regtype\n"
! " AND (p.proargtypes[0] IS NULL\n"
! " OR p.proargtypes[0] <> 'pg_catalog.cstring':g_catalog.regtype)\n"
" AND NOT p.proisagg\n");

processNamePattern(&buf, pattern, true, false,
***************
*** 491,497 ****
" LEFT JOIN pg_catalog.pg_namespace n ON n.oid = p.pronamespace\n"

" WHERE p.prorettype <> 'pg_catalog.cstring':g_catalog.regtype\n"
! " AND p.proargtypes[0] <> 'pg_catalog.cstring':g_catalog.regtype\n"
" AND NOT p.proisagg\n",
_("function"));
processNamePattern(&buf, pattern, true, false,
--- 492,499 ----
" LEFT JOIN pg_catalog.pg_namespace n ON n.oid = p.pronamespace\n"

" WHERE p.prorettype <> 'pg_catalog.cstring':g_catalog.regtype\n"
! " AND (p.proargtypes[0] IS NULL\n"
! " OR p.proargtypes[0] <> 'pg_catalog.cstring':g_catalog.regtype)\n"
" AND NOT p.proisagg\n",
_("function"));
processNamePattern(&buf, pattern, true, false,


---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 05:10 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com