BUG #4547: sort columns in \d

Поиск
Список
Период
Сортировка
От Ferdinand Gassauer
Тема BUG #4547: sort columns in \d
Дата
Msg-id 200811231619.mANGJciW041976@wwwmaster.postgresql.org
обсуждение исходный текст
Ответы Re: BUG #4547: sort columns in \d  (toruvinn <toruvinn@lain.pl>)
Re: BUG #4547: sort columns in \d  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
The following bug has been logged online:

Bug reference:      4547
Logged by:          Ferdinand Gassauer
Email address:      gassauer@kde.org
PostgreSQL version: 8.3.5
Operating system:   any
Description:        sort columns in \d
Details:

currently the columns are sorted by attnum (not very userfriendly) instead
of attname (userfriendly)

this patch fixes this and makes the output of \d much more usable.

thank you for listening


--- describe.c.dist     2008-11-23 16:59:07.000000000 +0100
+++ describe.c  2008-11-23 16:59:28.000000000 +0100
@@ -867,7 +867,7 @@ describeOneTableDetails(const char *sche
        appendPQExpBuffer(&buf, "\nWHERE a.attrelid = '%s' AND a.attnum > 0
AND NOT a.attisdropped", oid);
        if (tableinfo.relkind == 'i')
                appendPQExpBuffer(&buf, " AND a.attrelid = i.indexrelid");
-       appendPQExpBuffer(&buf, "\nORDER BY a.attnum");
+       appendPQExpBuffer(&buf, "\nORDER BY a.attname");

        res = PSQLexec(buf.data, false);
        if (!res)

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Gregory Stark
Дата:
Сообщение: Re: could not read block 77 of relation 1663/16385/388818775
Следующее
От: toruvinn
Дата:
Сообщение: Re: BUG #4547: sort columns in \d