Skip to content

Commit 135f65e

Browse files
committed
Adjust pg_proc.proargtypes[0] tests in psql \df to handle new NULL value
for a function taking no arguments, per report from Michael Fuhr.
1 parent 9336d63 commit 135f65e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/bin/psql/describe.c

+5-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright (c) 2000-2005, PostgreSQL Global Development Group
55
*
6-
* $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.113 2005/03/16 23:52:18 neilc Exp $
6+
* $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.114 2005/04/01 05:30:38 momjian Exp $
77
*/
88
#include "postgres_fe.h"
99
#include "describe.h"
@@ -201,7 +201,8 @@ describeFunctions(const char *pattern, bool verbose)
201201
*/
202202
appendPQExpBuffer(&buf,
203203
"WHERE p.prorettype <> 'pg_catalog.cstring'::pg_catalog.regtype\n"
204-
" AND p.proargtypes[0] <> 'pg_catalog.cstring'::pg_catalog.regtype\n"
204+
" AND (p.proargtypes[0] IS NULL\n"
205+
" OR p.proargtypes[0] <> 'pg_catalog.cstring'::pg_catalog.regtype)\n"
205206
" AND NOT p.proisagg\n");
206207

207208
processNamePattern(&buf, pattern, true, false,
@@ -491,7 +492,8 @@ objectDescription(const char *pattern)
491492
" LEFT JOIN pg_catalog.pg_namespace n ON n.oid = p.pronamespace\n"
492493

493494
" WHERE p.prorettype <> 'pg_catalog.cstring'::pg_catalog.regtype\n"
494-
" AND p.proargtypes[0] <> 'pg_catalog.cstring'::pg_catalog.regtype\n"
495+
" AND (p.proargtypes[0] IS NULL\n"
496+
" OR p.proargtypes[0] <> 'pg_catalog.cstring'::pg_catalog.regtype)\n"
495497
" AND NOT p.proisagg\n",
496498
_("function"));
497499
processNamePattern(&buf, pattern, true, false,

0 commit comments

Comments
 (0)