summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane2002-08-09 18:06:57 +0000
committerTom Lane2002-08-09 18:06:57 +0000
commit9c5dacc5e9d72332c82f882ede725d1d995e9806 (patch)
tree8a1edbd1e839f7bfce979432030979d25db26862
parent4ab8e69094452286a5894f1b2b237304808f4391 (diff)
Column ordering in \d output should agree with sort ordering;
per Joe Conway's patch of 20-July.
-rw-r--r--src/bin/psql/describe.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index bff6c5b73d0..8deffacb5fa 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -3,7 +3,7 @@
*
* Copyright 2000 by PostgreSQL Global Development Group
*
- * $Header: /cvsroot/pgsql/src/bin/psql/describe.c,v 1.57 2002/08/02 18:15:08 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/bin/psql/describe.c,v 1.58 2002/08/09 18:06:57 tgl Exp $
*/
#include "postgres_fe.h"
#include "describe.h"
@@ -1021,11 +1021,11 @@ listTables(const char *infotype, const char *name, bool desc)
initPQExpBuffer(&buf);
printfPQExpBuffer(&buf,
- "SELECT c.relname as \"%s\",\n"
- " n.nspname as \"%s\",\n"
+ "SELECT n.nspname as \"%s\",\n"
+ " c.relname as \"%s\",\n"
" 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"
" u.usename as \"%s\"",
- _("Name"), _("Schema"), _("table"), _("view"), _("index"), _("sequence"),
+ _("Schema"), _("Name"), _("table"), _("view"), _("index"), _("sequence"),
_("special"), _("Type"), _("Owner"));
if (desc)
@@ -1068,7 +1068,7 @@ listTables(const char *infotype, const char *name, bool desc)
if (name)
appendPQExpBuffer(&buf, " AND c.relname ~ '^%s'\n", name);
- appendPQExpBuffer(&buf, "ORDER BY 2,1;");
+ appendPQExpBuffer(&buf, "ORDER BY 1,2;");
res = PSQLexec(buf.data);
termPQExpBuffer(&buf);