|
3 | 3 | *
|
4 | 4 | * Copyright (c) 2000-2004, PostgreSQL Global Development Group
|
5 | 5 | *
|
6 |
| - * $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.106 2004/08/29 05:06:54 momjian Exp $ |
| 6 | + * $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.107 2004/09/10 04:10:53 neilc Exp $ |
7 | 7 | */
|
8 | 8 | #include "postgres_fe.h"
|
9 | 9 | #include "describe.h"
|
@@ -169,12 +169,12 @@ describeFunctions(const char *pattern, bool verbose)
|
169 | 169 | initPQExpBuffer(&buf);
|
170 | 170 |
|
171 | 171 | printfPQExpBuffer(&buf,
|
172 |
| - "SELECT CASE WHEN p.proretset THEN 'setof ' ELSE '' END ||\n" |
173 |
| - " pg_catalog.format_type(p.prorettype, NULL) as \"%s\",\n" |
174 |
| - " n.nspname as \"%s\",\n" |
| 172 | + "SELECT n.nspname as \"%s\",\n" |
175 | 173 | " p.proname as \"%s\",\n"
|
176 |
| - " pg_catalog.oidvectortypes(p.proargtypes) as \"%s\"", |
177 |
| - _("Result data type"), _("Schema"), _("Name"), |
| 174 | + " CASE WHEN p.proretset THEN 'setof ' ELSE '' END ||\n" |
| 175 | + " pg_catalog.format_type(p.prorettype, NULL) as \"%s\",\n" |
| 176 | + " pg_catalog.oidvectortypes(p.proargtypes) as \"%s\"", |
| 177 | + _("Schema"), _("Name"), _("Result data type"), |
178 | 178 | _("Argument data types"));
|
179 | 179 |
|
180 | 180 | if (verbose)
|
@@ -210,7 +210,7 @@ describeFunctions(const char *pattern, bool verbose)
|
210 | 210 | "n.nspname", "p.proname", NULL,
|
211 | 211 | "pg_catalog.pg_function_is_visible(p.oid)");
|
212 | 212 |
|
213 |
| - appendPQExpBuffer(&buf, "ORDER BY 2, 3, 1, 4;"); |
| 213 | + appendPQExpBuffer(&buf, "ORDER BY 1, 2, 3, 4;"); |
214 | 214 |
|
215 | 215 | res = PSQLexec(buf.data, false);
|
216 | 216 | termPQExpBuffer(&buf);
|
@@ -1477,20 +1477,23 @@ listTables(const char *tabtypes, const char *pattern, bool verbose)
|
1477 | 1477 | _("table"), _("view"), _("index"), _("sequence"),
|
1478 | 1478 | _("special"), _("Type"), _("Owner"));
|
1479 | 1479 |
|
| 1480 | + if (showIndexes) |
| 1481 | + appendPQExpBuffer(&buf, |
| 1482 | + ",\n c2.relname as \"%s\"", |
| 1483 | + _("Table")); |
| 1484 | + |
1480 | 1485 | if (verbose)
|
1481 | 1486 | appendPQExpBuffer(&buf,
|
1482 | 1487 | ",\n pg_catalog.obj_description(c.oid, 'pg_class') as \"%s\"",
|
1483 | 1488 | _("Description"));
|
1484 | 1489 |
|
1485 | 1490 | if (showIndexes)
|
1486 | 1491 | appendPQExpBuffer(&buf,
|
1487 |
| - ",\n c2.relname as \"%s\"" |
1488 | 1492 | "\nFROM pg_catalog.pg_class c"
|
1489 | 1493 | "\n JOIN pg_catalog.pg_index i ON i.indexrelid = c.oid"
|
1490 | 1494 | "\n JOIN pg_catalog.pg_class c2 ON i.indrelid = c2.oid"
|
1491 | 1495 | "\n LEFT JOIN pg_catalog.pg_user u ON u.usesysid = c.relowner"
|
1492 |
| - "\n LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace\n", |
1493 |
| - _("Table")); |
| 1496 | + "\n LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace\n"); |
1494 | 1497 | else
|
1495 | 1498 | appendPQExpBuffer(&buf,
|
1496 | 1499 | "\nFROM pg_catalog.pg_class c"
|
|
0 commit comments