Re: [PATCHES] Minor psql consistency fixes

2004-09-09 Thread Neil Conway
Greg Sabino Mullane wrote:
Minor consistency fixes: have \df show schema and name first, 
make sure \di+ shows description last, and make \dl SQL look 
a little more standard.
Patch applied -- thanks!
-Neil
---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
   (send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])


Re: [PATCHES] Minor psql consistency fixes

2004-09-09 Thread Neil Conway
Greg Sabino Mullane wrote:
Minor consistency fixes: have \df show schema and name first, 
make sure \di+ shows description last, and make \dl SQL look 
a little more standard.
I'll apply this in the next 24 hours, barring any objections.
-Neil
---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster


[PATCHES] Minor psql consistency fixes

2004-09-05 Thread Greg Sabino Mullane

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
NotDashEscaped: You need GnuPG to verify this message


Minor consistency fixes: have \df show schema and name first, 
make sure \di+ shows description last, and make \dl SQL look 
a little more standard.

Index: describe.c
===
RCS file: /projects/cvsroot/pgsql-server/src/bin/psql/describe.c,v
retrieving revision 1.106
diff -c -r1.106 describe.c
*** describe.c  29 Aug 2004 05:06:54 -  1.106
--- describe.c  5 Sep 2004 16:05:42 -
***
*** 169,181 
initPQExpBuffer(&buf);
  
printfPQExpBuffer(&buf,
!   "SELECT CASE WHEN p.proretset THEN 'setof ' ELSE '' END ||\n"
! "  pg_catalog.format_type(p.prorettype, NULL) as \"%s\",\n"
! "  n.nspname as \"%s\",\n"
! "  p.proname as \"%s\",\n"
! "  pg_catalog.oidvectortypes(p.proargtypes) as 
\"%s\"",
! _("Result data type"), _("Schema"), 
_("Name"),
! _("Argument data types"));
  
if (verbose)
appendPQExpBuffer(&buf,
--- 169,181 
initPQExpBuffer(&buf);
  
printfPQExpBuffer(&buf,
!   
"SELECT n.nspname as \"%s\",\n"
!   "  
p.proname as \"%s\",\n"
!   "  
CASE WHEN p.proretset THEN 'setof ' ELSE '' END ||\n"
!   "  
pg_catalog.format_type(p.prorettype, NULL) as \"%s\",\n"
!   "  
pg_catalog.oidvectortypes(p.proargtypes) as \"%s\"",
!   
_("Schema"), _("Name"), _("Result data type"), 
!   
_("Argument data types"));
  
if (verbose)
appendPQExpBuffer(&buf,
***
*** 210,216 
   "n.nspname", "p.proname", NULL,
   "pg_catalog.pg_function_is_visible(p.oid)");
  
!   appendPQExpBuffer(&buf, "ORDER BY 2, 3, 1, 4;");
  
res = PSQLexec(buf.data, false);
termPQExpBuffer(&buf);
--- 210,216 
   "n.nspname", "p.proname", NULL,
   "pg_catalog.pg_function_is_visible(p.oid)");
  
!   appendPQExpBuffer(&buf, "ORDER BY 1, 2, 3, 4;");
  
res = PSQLexec(buf.data, false);
termPQExpBuffer(&buf);
***
*** 1477,1482 
--- 1477,1487 
  _("table"), _("view"), _("index"), 
_("sequence"),
  _("special"), _("Type"), _("Owner"));
  
+   if (showIndexes)
+   appendPQExpBuffer(&buf,
+ ",\n c2.relname as \"%s\"",
+ _("Table"));
+ 
if (verbose)
appendPQExpBuffer(&buf,
  ",\n  pg_catalog.obj_description(c.oid, 'pg_class') as \"%s\"",
***
*** 1484,1496 
  
if (showIndexes)
appendPQExpBuffer(&buf,
- ",\n c2.relname as \"%s\""
  "\nFROM pg_catalog.pg_class c"
  "\n JOIN pg_catalog.pg_index i ON i.indexrelid = c.oid"
  "\n JOIN pg_catalog.pg_class c2 ON i.indrelid = c2.oid"
"\n LEFT JOIN pg_catalog.pg_user u ON u.usesysid = c.relowner"
! "\n LEFT JOIN 
pg_catalog.pg_namespace n ON n.oid = c.relnamespace\n",
! _("Table"));
else
appendPQExpBuffer(&buf,
  "\nFROM pg_catalog.pg_class c"
--- 1489,1499 
  
if (showIndexes)
appendPQExpBuffer(&buf,
  "\nFROM pg_catalog.pg_class c"
  "\n JOIN pg_catalog.pg_index i ON i.indexrelid = c.oid"
  "\n JOIN pg_catalog.pg_class c2 ON i.indrelid = c2.oid"
"\n LEFT JOIN pg_catalog.pg_user u ON u.usesysid = c.relowner"
! "\n LEFT JOIN 
pg_catalog.pg_namespace n ON n.oid = c.relnamespace\n");
else
appendPQExpBuffer(&buf,