|
8 | 8 | *
|
9 | 9 | * Copyright (c) 2000-2008, PostgreSQL Global Development Group
|
10 | 10 | *
|
11 |
| - * $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.177 2008/07/14 22:00:04 momjian Exp $ |
| 11 | + * $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.178 2008/07/14 22:51:48 momjian Exp $ |
12 | 12 | */
|
13 | 13 | #include "postgres_fe.h"
|
14 | 14 |
|
@@ -811,7 +811,7 @@ describeOneTableDetails(const char *schemaname,
|
811 | 811 | printTableContent cont;
|
812 | 812 | int i;
|
813 | 813 | char *view_def = NULL;
|
814 |
| - char *headers[4]; |
| 814 | + char *headers[5]; |
815 | 815 | char **modifiers = NULL;
|
816 | 816 | char **ptr;
|
817 | 817 | PQExpBufferData title;
|
@@ -878,7 +878,7 @@ describeOneTableDetails(const char *schemaname,
|
878 | 878 | "\n WHERE d.adrelid = a.attrelid AND d.adnum = a.attnum AND a.atthasdef),"
|
879 | 879 | "\n a.attnotnull, a.attnum");
|
880 | 880 | if (verbose)
|
881 |
| - appendPQExpBuffer(&buf, ", pg_catalog.col_description(a.attrelid, a.attnum)"); |
| 881 | + appendPQExpBuffer(&buf, ", a.attstorage, pg_catalog.col_description(a.attrelid, a.attnum)"); |
882 | 882 | appendPQExpBuffer(&buf, "\nFROM pg_catalog.pg_attribute a");
|
883 | 883 | if (tableinfo.relkind == 'i')
|
884 | 884 | appendPQExpBuffer(&buf, ", pg_catalog.pg_index i");
|
@@ -933,19 +933,22 @@ describeOneTableDetails(const char *schemaname,
|
933 | 933 |
|
934 | 934 | /* Set the number of columns, and their names */
|
935 | 935 | cols = 2;
|
936 |
| - headers[0] = "Column"; |
937 |
| - headers[1] = "Type"; |
| 936 | + headers[0] = gettext_noop("Column"); |
| 937 | + headers[1] = gettext_noop("Type"); |
938 | 938 |
|
939 | 939 | if (tableinfo.relkind == 'r' || tableinfo.relkind == 'v')
|
940 | 940 | {
|
941 | 941 | show_modifiers = true;
|
942 |
| - headers[cols++] = "Modifiers"; |
| 942 | + headers[cols++] = gettext_noop("Modifiers"); |
943 | 943 | modifiers = pg_malloc_zero((numrows + 1) * sizeof(*modifiers));
|
944 | 944 | }
|
945 | 945 |
|
946 | 946 | if (verbose)
|
947 |
| - headers[cols++] = "Description"; |
948 |
| - |
| 947 | + { |
| 948 | + headers[cols++] = gettext_noop("Storage"); |
| 949 | + headers[cols++] = gettext_noop("Description"); |
| 950 | + } |
| 951 | + |
949 | 952 | printTableInit(&cont, &myopt, title.data, cols, numrows);
|
950 | 953 |
|
951 | 954 | for (i = 0; i < cols; i++)
|
@@ -1000,9 +1003,18 @@ describeOneTableDetails(const char *schemaname,
|
1000 | 1003 | printTableAddCell(&cont, modifiers[i], false);
|
1001 | 1004 | }
|
1002 | 1005 |
|
1003 |
| - /* Description */ |
| 1006 | + /* Storage and Description */ |
1004 | 1007 | if (verbose)
|
1005 |
| - printTableAddCell(&cont, PQgetvalue(res, i, 5), false); |
| 1008 | + { |
| 1009 | + char *storage = PQgetvalue(res, i, 5); |
| 1010 | + printTableAddCell(&cont, (storage[0]=='p' ? "plain" : |
| 1011 | + (storage[0]=='m' ? "main" : |
| 1012 | + (storage[0]=='x' ? "extended" : |
| 1013 | + (storage[0]=='e' ? "external" : |
| 1014 | + "???")))), |
| 1015 | + false); |
| 1016 | + printTableAddCell(&cont, PQgetvalue(res, i, 6), false); |
| 1017 | + } |
1006 | 1018 | }
|
1007 | 1019 |
|
1008 | 1020 | /* Make footers */
|
|
0 commit comments