From: | Gregory Stark <stark(at)enterprisedb(dot)com> |
---|---|
To: | "Alvaro Herrera" <alvherre(at)commandprompt(dot)com> |
Cc: | <pgsql-patches(at)postgresql(dot)org>, "Oleg Bartunov" <oleg(at)sai(dot)msu(dot)su> |
Subject: | Re: \d+ should display the storage options for columns |
Date: | 2008-05-23 18:55:26 |
Message-ID: | 87d4ncu9y9.fsf@oxford.xeocode.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-patches |
"Alvaro Herrera" <alvherre(at)commandprompt(dot)com> writes:
> This seems to be against an older version of psql ... with the
> printTable API stuff, we reworked this -- in particular the mbvalidate()
> call that's only on WIN32 is gone (actually it's the lack of it that's
> gone.)
Sorry. Here's a patch against a current sync of HEAD.
Incidentally how can this new API work? Calling _() on a function parameter
would work but how would the translation tools know what strings need to be
translated?
Index: src/bin/psql/describe.c
===================================================================
RCS file: /home/stark/src/REPOSITORY/pgsql/src/bin/psql/describe.c,v
retrieving revision 1.173
diff -c -r1.173 describe.c
*** src/bin/psql/describe.c 13 May 2008 00:23:17 -0000 1.173
--- src/bin/psql/describe.c 23 May 2008 18:52:57 -0000
***************
*** 784,790 ****
printTableContent cont;
int i;
char *view_def = NULL;
! char *headers[4];
char **modifiers = NULL;
char **ptr;
PQExpBufferData title;
--- 784,790 ----
printTableContent cont;
int i;
char *view_def = NULL;
! char *headers[5];
char **modifiers = NULL;
char **ptr;
PQExpBufferData title;
***************
*** 852,858 ****
"\n WHERE d.adrelid = a.attrelid AND d.adnum = a.attnum AND a.atthasdef),"
"\n a.attnotnull, a.attnum");
if (verbose)
! appendPQExpBuffer(&buf, ", pg_catalog.col_description(a.attrelid, a.attnum)");
appendPQExpBuffer(&buf, "\nFROM pg_catalog.pg_attribute a");
if (tableinfo.relkind == 'i')
appendPQExpBuffer(&buf, ", pg_catalog.pg_index i");
--- 852,858 ----
"\n WHERE d.adrelid = a.attrelid AND d.adnum = a.attnum AND a.atthasdef),"
"\n a.attnotnull, a.attnum");
if (verbose)
! appendPQExpBuffer(&buf, ", a.attstorage, pg_catalog.col_description(a.attrelid, a.attnum)");
appendPQExpBuffer(&buf, "\nFROM pg_catalog.pg_attribute a");
if (tableinfo.relkind == 'i')
appendPQExpBuffer(&buf, ", pg_catalog.pg_index i");
***************
*** 918,924 ****
--- 918,927 ----
}
if (verbose)
+ {
+ headers[cols++] = "Storage";
headers[cols++] = "Description";
+ }
printTableInit(&cont, &myopt, title.data, cols, numrows);
***************
*** 972,980 ****
printTableAddCell(&cont, modifiers[i], false);
}
! /* Description */
if (verbose)
! printTableAddCell(&cont, PQgetvalue(res, i, 5), false);
}
/* Make footers */
--- 975,992 ----
printTableAddCell(&cont, modifiers[i], false);
}
! /* Storage and Description */
if (verbose)
! {
! char *storage = PQgetvalue(res, i, 5);
! printTableAddCell(&cont, (storage[0]=='p' ? "plain" :
! (storage[0]=='m' ? "main" :
! (storage[0]=='x' ? "extended" :
! (storage[0]=='e' ? "external" :
! "???")))),
! false);
! printTableAddCell(&cont, PQgetvalue(res, i, 6), false);
! }
}
/* Make footers */
--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com
Get trained by Bruce Momjian - ask me about EnterpriseDB's PostgreSQL training!
From | Date | Subject | |
---|---|---|---|
Next Message | Yoshiyuki Asaba | 2008-05-23 20:01:11 | Re: WITH RECURSIVE patch V0.1 |
Previous Message | David Fetter | 2008-05-23 18:26:30 | Re: WITH RECURSIVE patch V0.1 |