Skip to content

Commit b686104

Browse files
committed
Change \df order.
1 parent 7372b8c commit b686104

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

src/bin/psql/psql.c

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.112 1997/11/18 06:46:21 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.113 1997/11/19 03:14:19 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -1709,19 +1709,33 @@ HandleSlashCmds(PsqlSettings *pset,
17091709
/* descriptions */
17101710
objectDescription(pset, optarg+1, NULL);
17111711
else if (strncmp(cmd, "df", 2) == 0)
1712+
{
17121713
/* functions/procedures */
17131714
/* we skip in/out funcs by excluding functions that take
17141715
some arguments, but have no types defined for those arguments */
17151716
SendQuery(&success, pset,"\
1716-
SELECT p.proname as function, \
1717-
t.typname as return_type, \
1717+
SELECT t.typname as return_type, \
1718+
p.proname as function, \
1719+
oid8types(p.proargtypes) as arguments, \
1720+
obj_description(p.oid) \
1721+
FROM pg_proc p, pg_type t \
1722+
WHERE p.prorettype = t.oid and \
1723+
(pronargs = 0 or oid8types(p.proargtypes) != '') and \
1724+
t.typname != 'bool' \
1725+
ORDER BY return_type, function;",
1726+
false, false, 0);
1727+
SendQuery(&success, pset,"\
1728+
SELECT t.typname as return_type, \
1729+
p.proname as function, \
17181730
oid8types(p.proargtypes) as arguments, \
17191731
obj_description(p.oid) \
17201732
FROM pg_proc p, pg_type t \
17211733
WHERE p.prorettype = t.oid and \
1722-
(pronargs = 0 or oid8types(p.proargtypes) != '') \
1723-
ORDER BY function;",
1734+
(pronargs = 0 or oid8types(p.proargtypes) != '') and \
1735+
t.typname = 'bool' \
1736+
ORDER BY return_type, function;",
17241737
false, false, 0);
1738+
}
17251739
else if (strncmp(cmd, "di", 2) == 0)
17261740
/* only indices */
17271741
tableList(pset, false, 'i', false);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy