|
3 | 3 | *
|
4 | 4 | * Copyright 2000 by PostgreSQL Global Development Group
|
5 | 5 | *
|
6 |
| - * $Header: /cvsroot/pgsql/src/bin/psql/describe.c,v 1.57 2002/08/02 18:15:08 tgl Exp $ |
| 6 | + * $Header: /cvsroot/pgsql/src/bin/psql/describe.c,v 1.58 2002/08/09 18:06:57 tgl Exp $ |
7 | 7 | */
|
8 | 8 | #include "postgres_fe.h"
|
9 | 9 | #include "describe.h"
|
@@ -1021,11 +1021,11 @@ listTables(const char *infotype, const char *name, bool desc)
|
1021 | 1021 | initPQExpBuffer(&buf);
|
1022 | 1022 |
|
1023 | 1023 | printfPQExpBuffer(&buf,
|
1024 |
| - "SELECT c.relname as \"%s\",\n" |
1025 |
| - " n.nspname as \"%s\",\n" |
| 1024 | + "SELECT n.nspname as \"%s\",\n" |
| 1025 | + " c.relname as \"%s\",\n" |
1026 | 1026 | " CASE c.relkind WHEN 'r' THEN '%s' WHEN 'v' THEN '%s' WHEN 'i' THEN '%s' WHEN 'S' THEN '%s' WHEN 's' THEN '%s' END as \"%s\",\n"
|
1027 | 1027 | " u.usename as \"%s\"",
|
1028 |
| - _("Name"), _("Schema"), _("table"), _("view"), _("index"), _("sequence"), |
| 1028 | + _("Schema"), _("Name"), _("table"), _("view"), _("index"), _("sequence"), |
1029 | 1029 | _("special"), _("Type"), _("Owner"));
|
1030 | 1030 |
|
1031 | 1031 | if (desc)
|
@@ -1068,7 +1068,7 @@ listTables(const char *infotype, const char *name, bool desc)
|
1068 | 1068 | if (name)
|
1069 | 1069 | appendPQExpBuffer(&buf, " AND c.relname ~ '^%s'\n", name);
|
1070 | 1070 |
|
1071 |
| - appendPQExpBuffer(&buf, "ORDER BY 2,1;"); |
| 1071 | + appendPQExpBuffer(&buf, "ORDER BY 1,2;"); |
1072 | 1072 |
|
1073 | 1073 | res = PSQLexec(buf.data);
|
1074 | 1074 | termPQExpBuffer(&buf);
|
|
0 commit comments