*** pgsql/src/bin/psql/describe.c 2008/07/14 22:00:04 1.177 --- pgsql/src/bin/psql/describe.c 2008/07/14 22:51:48 1.178 *************** *** 8,14 **** * * Copyright (c) 2000-2008, PostgreSQL Global Development Group * ! * $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.176 2008/07/12 10:44:56 petere Exp $ */ #include "postgres_fe.h" --- 8,14 ---- * * Copyright (c) 2000-2008, PostgreSQL Global Development Group * ! * $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.177 2008/07/14 22:00:04 momjian Exp $ */ #include "postgres_fe.h" *************** describeOneTableDetails(const char *sche *** 811,817 **** printTableContent cont; int i; char *view_def = NULL; ! char *headers[4]; char **modifiers = NULL; char **ptr; PQExpBufferData title; --- 811,817 ---- printTableContent cont; int i; char *view_def = NULL; ! char *headers[5]; char **modifiers = NULL; char **ptr; PQExpBufferData title; *************** describeOneTableDetails(const char *sche *** 878,884 **** "\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"); --- 878,884 ---- "\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"); *************** describeOneTableDetails(const char *sche *** 933,951 **** /* Set the number of columns, and their names */ cols = 2; ! headers[0] = "Column"; ! headers[1] = "Type"; if (tableinfo.relkind == 'r' || tableinfo.relkind == 'v') { show_modifiers = true; ! headers[cols++] = "Modifiers"; modifiers = pg_malloc_zero((numrows + 1) * sizeof(*modifiers)); } if (verbose) ! headers[cols++] = "Description"; ! printTableInit(&cont, &myopt, title.data, cols, numrows); for (i = 0; i < cols; i++) --- 933,954 ---- /* Set the number of columns, and their names */ cols = 2; ! headers[0] = gettext_noop("Column"); ! headers[1] = gettext_noop("Type"); if (tableinfo.relkind == 'r' || tableinfo.relkind == 'v') { show_modifiers = true; ! headers[cols++] = gettext_noop("Modifiers"); modifiers = pg_malloc_zero((numrows + 1) * sizeof(*modifiers)); } if (verbose) ! { ! headers[cols++] = gettext_noop("Storage"); ! headers[cols++] = gettext_noop("Description"); ! } ! printTableInit(&cont, &myopt, title.data, cols, numrows); for (i = 0; i < cols; i++) *************** describeOneTableDetails(const char *sche *** 1000,1008 **** printTableAddCell(&cont, modifiers[i], false); } ! /* Description */ if (verbose) ! printTableAddCell(&cont, PQgetvalue(res, i, 5), false); } /* Make footers */ --- 1003,1020 ---- 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 */