Re: [COMMITTERS] pgsql: This makes all the \dX commands (most importantly to most: \df)

Поиск
Список
Период
Сортировка
Искать

Re: [COMMITTERS] pgsql: This makes all the \dX commands (most importantly to most: \df)

От:
Bruce Momjian <bruce@momjian.us>
Дата:
Bruce Momjian wrote:
> Tom Lane wrote:
> > momjian@postgresql.org (Bruce Momjian) writes:
> > > This makes all the \dX commands (most importantly to most: \df) work
> > > like \dt does, in that it requires a \dXS to see system items.
> > 
> > The lack of any documentation change is glaring.
> 
> Oh, it sure does.  I will work on that.

OK, documentation added with the attached patch, applied.  The
documentation needed quite a bit of cleanup, independent of this patch,
which I did.

I also found a bug that \do didn't work because the AND system table
check was being added to the LEFT JOIN and not to the WHERE clause
(trigger display was also a problem).

-- 
  Bruce Momjian          http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +
Index: doc/src/sgml/ref/psql-ref.sgml
===================================================================
RCS file: /cvsroot/pgsql/doc/src/sgml/ref/psql-ref.sgml,v
retrieving revision 1.214
diff -c -c -r1.214 psql-ref.sgml
*** doc/src/sgml/ref/psql-ref.sgml	19 Dec 2008 16:25:16 -0000	1.214
--- doc/src/sgml/ref/psql-ref.sgml	6 Jan 2009 22:48:33 -0000
***************
*** 815,822 ****
        
  
        
!         \d [ pattern ]
!         \d+ [ pattern ]
  
          
          
--- 815,821 ----
        
  
        
!         \d[S+] [ pattern ]
  
          
          
***************
*** 834,839 ****
--- 833,840 ----
          more information is displayed: any comments associated with the
          columns of the table are shown, as is the presence of OIDs in the
          table.
+         The letter S restricts the listing to system objects; without
+         S, only non-system objects are shown.
          
  
          
***************
*** 849,855 ****
        
  
        
!         \da [ pattern ]
  
          
          
--- 850,856 ----
        
  
        
!         \da[S] [ pattern ]
  
          
          
***************
*** 857,870 ****
          return type and the data types they operate on. If pattern
          is specified, only aggregates whose names match the pattern are shown.
          
          
        
  
  
        
!         \db [ pattern ]
!         \db+ [ pattern ]
  
          
          
--- 858,873 ----
          return type and the data types they operate on. If pattern
          is specified, only aggregates whose names match the pattern are shown.
+         The letter S restricts the listing
+         to system objects; without S, only
+         non-system objects are shown.
          
          
        
  
  
        
!         \db[+] [ pattern ]
  
          
          
***************
*** 879,891 ****
  
  
        
!         \dc [ pattern ]
          
          
          Lists all available conversions between character-set encodings.
          If pattern
          is specified, only conversions whose names match the pattern are
          listed.
          
          
        
--- 882,896 ----
  
  
        
!         \dc[S] [ pattern ]
          
          
          Lists all available conversions between character-set encodings.
          If pattern
          is specified, only conversions whose names match the pattern are
          listed.
+         The letter S restricts the listing to system objects; without
+         S, only non-system objects are shown.
          
          
        
***************
*** 905,917 ****
  
  
        
!         \dd [ pattern ]
          
          
          Shows the descriptions of objects matching the pattern, or of all visible objects if
          no argument is given.  But in either case, only objects that have
          a description are listed.
          (Object covers aggregates, functions, operators,
          types, relations (tables, views, indexes, sequences, large
          objects), rules, and triggers.) For example:
--- 910,924 ----
  
  
        
!         \dd[S] [ pattern ]
          
          
          Shows the descriptions of objects matching the pattern, or of all visible objects if
          no argument is given.  But in either case, only objects that have
          a description are listed.
+         The letter S restricts the listing to system objects; without
+         S, only non-system objects are shown.
          (Object covers aggregates, functions, operators,
          types, relations (tables, views, indexes, sequences, large
          objects), rules, and triggers.) For example:
***************
*** 935,954 ****
  
  
        
!         \dD [ pattern ]
          
          
          Lists all available domains. If pattern
          is specified, only matching domains are shown.
          
          
        
  
  
        
!         \des [ pattern ]
!         \des+ [ pattern ]
          
          
          Lists all foreign servers (mnemonic: external
--- 942,962 ----
  
  
        
!         \dD[S] [ pattern ]
          
          
          Lists all available domains. If pattern
          is specified, only matching domains are shown.
+         The letter S restricts the listing to system objects; without
+         S, only non-system objects are shown.
          
          
        
  
  
        
!         \des[+] [ pattern ]
          
          
          Lists all foreign servers (mnemonic: external
***************
*** 964,971 ****
  
  
        
!         \deu [ pattern ]
!         \deu+ [ pattern ]
          
          
          Lists all user mappings (mnemonic: external
--- 972,978 ----
  
  
        
!         \deu[+] [ pattern ]
          
          
          Lists all user mappings (mnemonic: external
***************
*** 988,995 ****
  
  
        
!         \dew [ pattern ]
!         \dew+ [ pattern ]
          
          
          Lists all foreign-data wrappers (mnemonic: external
--- 995,1001 ----
  
  
        
!         \dew[+] [ pattern ]
          
          
          Lists all foreign-data wrappers (mnemonic: external
***************
*** 1005,1012 ****
  
  
        
!         \df [ pattern ]
!         \df+ [ pattern ]
  
          
          
--- 1011,1017 ----
  
  
        
!         \df[S+] [ pattern ]
  
          
          
***************
*** 1016,1021 ****
--- 1021,1028 ----
          is specified, only functions whose names match the pattern are shown.
          If the form \df+ is used, additional information about
          each function, including volatility, language, source code and description, is shown.
+         The letter S restricts the listing to system objects; without
+         S, only non-system objects are shown.
          
  
          
***************
*** 1037,1044 ****
  
  
        
!         \dF [ pattern ]
!         \dF+ [ pattern ]
          
          
           Lists available text search configurations.
--- 1044,1050 ----
  
  
        
!         \dF[+] [ pattern ]
          
          
           Lists available text search configurations.
***************
*** 1052,1059 ****
        
  
        
!         \dFd [ pattern ]
!         \dFd+ [ pattern ]
          
          
           Lists available text search dictionaries.
--- 1058,1064 ----
        
  
        
!         \dFd[+] [ pattern ]
          
          
           Lists available text search dictionaries.
***************
*** 1067,1074 ****
        
  
        
!         \dFp [ pattern ]
!         \dFp+ [ pattern ]
          
          
           Lists available text search parsers.
--- 1072,1078 ----
        
  
        
!         \dFp[+] [ pattern ]
          
          
           Lists available text search parsers.
***************
*** 1082,1089 ****
        
  
        
!         \dFt [ pattern ]
!         \dFt+ [ pattern ]
          
          
           Lists available text search templates.
--- 1086,1092 ----
        
  
        
!         \dFt[+] [ pattern ]
          
          
           Lists available text search templates.
***************
*** 1110,1116 ****
  
  
        
!         \distvS [ pattern ]
  
          
          
--- 1113,1119 ----
  
  
        
!         \distv[S+] [ pattern ]
  
          
          
***************
*** 1120,1130 ****
          S stand for index, sequence, table, view,
          and system table, respectively. You can specify any or all of
          these letters, in any order, to obtain a listing of all the
!         matching objects.  The letter S restricts
!         the listing to system objects; without S,
!         only non-system objects are shown.  If + is
          appended to the command name, each object is listed with its
          physical size on disk and its associated description, if any.
          
  
          
--- 1123,1134 ----
          S stand for index, sequence, table, view,
          and system table, respectively. You can specify any or all of
          these letters, in any order, to obtain a listing of all the
!         matching objects.  If + is
          appended to the command name, each object is listed with its
          physical size on disk and its associated description, if any.
+         The letter S restricts the listing
+         to system objects; without S, only
+         non-system objects are shown.
          
  
          
***************
*** 1147,1154 ****
  
  
        
!         \dn [ pattern ]
!         \dn+ [ pattern ]
  
          
          
--- 1151,1157 ----
  
  
        
!         \dn[+] [ pattern ]
  
          
          
***************
*** 1164,1175 ****
  
  
        
!         \do [ pattern ]
          
          
          Lists available operators with their operand and return types.
          If pattern is
          specified, only operators whose names match the pattern are listed.
          
          
        
--- 1167,1181 ----
  
  
        
!         \do[S] [ pattern ]
          
          
          Lists available operators with their operand and return types.
          If pattern is
          specified, only operators whose names match the pattern are listed.
+         The letter S restricts the listing
+         to system objects; without S, only
+         non-system objects are shown.
          
          
        
***************
*** 1195,1208 ****
  
  
        
!         \dT [ pattern ]
!         \dT+ [ pattern ]
          
          
          Lists all data types or only those that match pattern. The command form
          \dT+ shows extra information, namely the type's internal name, size, and
          allowed values for enum</> types.
          
          
        
--- 1201,1215 ----
  
  
        
!         \dT[S+] [ pattern ]
          
          
          Lists all data types or only those that match pattern. The command form
          \dT+ shows extra information, namely the type's internal name, size, and
          allowed values for enum</> types.
+         The letter S restricts the listing to system objects; without
+         S, only non-system objects are shown.
          
          
        
Index: src/bin/psql/describe.c
===================================================================
RCS file: /cvsroot/pgsql/src/bin/psql/describe.c,v
retrieving revision 1.194
diff -c -c -r1.194 describe.c
*** src/bin/psql/describe.c	6 Jan 2009 21:10:30 -0000	1.194
--- src/bin/psql/describe.c	6 Jan 2009 22:48:34 -0000
***************
*** 428,434 ****
  					  gettext_noop("Description"));
  
   	if (!showSystem)
!  		appendPQExpBuffer(&buf, "      AND n.nspname <> 'pg_catalog'\n");
  
  	processSQLNamePattern(pset.db, &buf, pattern, !showSystem, true,
  						  "n.nspname", "o.oprname", NULL,
--- 428,434 ----
  					  gettext_noop("Description"));
  
   	if (!showSystem)
!  		appendPQExpBuffer(&buf, "      WHERE n.nspname <> 'pg_catalog'\n");
  
  	processSQLNamePattern(pset.db, &buf, pattern, !showSystem, true,
  						  "n.nspname", "o.oprname", NULL,
***************
*** 743,749 ****
  	"       LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace\n",
  					  gettext_noop("trigger"));
   	if (!showSystem)
!  		appendPQExpBuffer(&buf, "      AND n.nspname <> 'pg_catalog'\n");
  
  	/* XXX not sure what to do about visibility rule here? */
  	processSQLNamePattern(pset.db, &buf, pattern, !showSystem, false,
--- 743,749 ----
  	"       LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace\n",
  					  gettext_noop("trigger"));
   	if (!showSystem)
!  		appendPQExpBuffer(&buf, "      WHERE n.nspname <> 'pg_catalog'\n");
  
  	/* XXX not sure what to do about visibility rule here? */
  	processSQLNamePattern(pset.db, &buf, pattern, !showSystem, false,
Index: src/bin/psql/help.c
===================================================================
RCS file: /cvsroot/pgsql/src/bin/psql/help.c,v
retrieving revision 1.134
diff -c -c -r1.134 help.c
*** src/bin/psql/help.c	6 Jan 2009 21:10:30 -0000	1.134
--- src/bin/psql/help.c	6 Jan 2009 22:48:34 -0000
***************
*** 194,230 ****
  	fprintf(output, "\n");
  
  	fprintf(output, _("Informational\n"));
!  	fprintf(output, _("  Modifiers: S = show system objects  + = Additional detail\n"));
!  	fprintf(output, _("  \\l[+]             list all databases\n"));
!  	fprintf(output, _("  \\d[S]             list tables, views, and sequences\n"));
!  	fprintf(output, _("  \\d[S] NAME        describe table, view, sequence, or index\n"));
!  	fprintf(output, _("  \\dt[S+] [PATTERN] list tables\n"));
!  	fprintf(output, _("  \\dv[S+] [PATTERN] list views\n"));
!  	fprintf(output, _("  \\ds[S+] [PATTERN] list sequences\n"));
!  	fprintf(output, _("  \\di[S+] [PATTERN] list indexes\n"));
!  	fprintf(output, _("  \\df[S+] [PATTERN] list functions\n"));
!  	fprintf(output, _("  \\dT[S+] [PATTERN] list data types\n"));
!  	fprintf(output, _("  \\dd[S] [PATTERN]  list comments on objects\n"));
!  	fprintf(output, _("  \\dD[S] [PATTERN]  list domains\n"));
! 	fprintf(output, _("  \\des[+] [PATTERN] list foreign servers\n"));
! 	fprintf(output, _("  \\deu[+] [PATTERN] list user mappings\n"));
! 	fprintf(output, _("  \\dew[+] [PATTERN] list foreign-data wrappers\n"));
!  	fprintf(output, _("  \\do[S] [PATTERN]  list operators\n"));
!  	fprintf(output, _("  \\da[S] [PATTERN]  list aggregate functions\n"));
!  	fprintf(output, _("  \\dc[S] [PATTERN]  list conversions\n"));
!  	fprintf(output, _("  \\db[+] [PATTERN]  list tablespaces\n"));
!  	fprintf(output, _("  \\dn[+] [PATTERN]  list schemas\n"));
! 	fprintf(output, _("  \\dC               list casts\n"));
! 	fprintf(output, _("  \\dd [PATTERN]     show comment for object\n"));
! 	fprintf(output, _("  \\dF[+] [PATTERN]  list text search configurations\n"));
! 	fprintf(output, _("  \\dFd[+] [PATTERN] list text search dictionaries\n"));
! 	fprintf(output, _("  \\dFt [PATTERN]    list text search templates\n"));
! 	fprintf(output, _("  \\dFp[+] [PATTERN] list text search parsers\n"));
! 	fprintf(output, _("  \\dg [PATTERN]     list roles (groups)\n"));
! 	fprintf(output, _("  \\dl               list large objects, same as \\lo_list\n"));
! 	fprintf(output, _("  \\du [PATTERN]     list roles (users)\n"));
! 	fprintf(output, _("  \\dp [PATTERN]     list table, view, and sequence access privileges\n"));
! 	fprintf(output, _("  \\z [PATTERN]      same as \\dp\n"));
  	fprintf(output, "\n");
  
  	fprintf(output, _("Formatting\n"));
--- 194,230 ----
  	fprintf(output, "\n");
  
  	fprintf(output, _("Informational\n"));
! 	fprintf(output, _("  Modifiers: S = show system objects  + = Additional detail\n"));
! 	fprintf(output, _("  \\l[+]                list all databases\n"));
! 	fprintf(output, _("  \\d[S+]               list tables, views, and sequences\n"));
! 	fprintf(output, _("  \\d[S+] NAME          describe table, view, sequence, or index\n"));
! 	fprintf(output, _("  \\da[S] [PATTERN]     list aggregate functions\n"));
! 	fprintf(output, _("  \\db[+] [PATTERN]     list tablespaces\n"));
! 	fprintf(output, _("  \\dc[S] [PATTERN]     list conversions\n"));
! 	fprintf(output, _("  \\dC [PATTERN]        list casts\n"));
! 	fprintf(output, _("  \\dd [PATTERN]        show comment for object\n"));
! 	fprintf(output, _("  \\dd[S] [PATTERN]     list comments on objects\n"));
! 	fprintf(output, _("  \\dD[S] [PATTERN]     list domains\n"));
! 	fprintf(output, _("  \\des[+] [PATTERN]    list foreign servers\n"));
! 	fprintf(output, _("  \\deu[+] [PATTERN]    list user mappings\n"));
! 	fprintf(output, _("  \\dew[+] [PATTERN]    list foreign-data wrappers\n"));
! 	fprintf(output, _("  \\df[S+] [PATTERN]    list functions\n"));
! 	fprintf(output, _("  \\dF[+] [PATTERN]     list text search configurations\n"));
! 	fprintf(output, _("  \\dFd[+] [PATTERN]    list text search dictionaries\n"));
! 	fprintf(output, _("  \\dFp[+] [PATTERN]    list text search parsers\n"));
! 	fprintf(output, _("  \\dFt[+] [PATTERN]    list text search templates\n"));
! 	fprintf(output, _("  \\dg [PATTERN]        list roles (groups)\n"));
! 	fprintf(output, _("  \\di[S+] [PATTERN]    list indexes\n"));
! 	fprintf(output, _("  \\dl                  list large objects, same as \\lo_list\n"));
! 	fprintf(output, _("  \\dn[+] [PATTERN]     list schemas\n"));
! 	fprintf(output, _("  \\do[S] [PATTERN]     list operators\n"));
! 	fprintf(output, _("  \\dp [PATTERN]        list table, view, and sequence access privileges\n"));
! 	fprintf(output, _("    \\z [PATTERN]       same as \\dp\n"));
! 	fprintf(output, _("  \\ds[S+] [PATTERN]    list sequences\n"));
! 	fprintf(output, _("  \\dt[S+] [PATTERN]    list tables\n"));
! 	fprintf(output, _("  \\dT[S+] [PATTERN]    list data types\n"));
! 	fprintf(output, _("  \\du [PATTERN]        list roles (users)\n"));
! 	fprintf(output, _("  \\dv[S+] [PATTERN]    list views\n"));
  	fprintf(output, "\n");
  
  	fprintf(output, _("Formatting\n"));

Re: Re: [COMMITTERS] pgsql: This makes all the \dX commands (most importantly to most: \df)

От:
Bruce Momjian <bruce@momjian.us>
Дата:
Bruce Momjian wrote:
> Bruce Momjian wrote:
> > Tom Lane wrote:
> > > momjian@postgresql.org (Bruce Momjian) writes:
> > > > This makes all the \dX commands (most importantly to most: \df) work
> > > > like \dt does, in that it requires a \dXS to see system items.
> > > 
> > > The lack of any documentation change is glaring.
> > 
> > Oh, it sure does.  I will work on that.
> 
> OK, documentation added with the attached patch, applied.  The
> documentation needed quite a bit of cleanup, independent of this patch,
> which I did.
> 
> I also found a bug that \do didn't work because the AND system table
> check was being added to the LEFT JOIN and not to the WHERE clause
> (trigger display was also a problem).

Let me also say that that \d* display is ready to fall over from its own
weight:
Informational  Modifiers: S = show system objects  + = Additional detail  \l[+]                list all databases  \d[S+]               list tables, views, and sequences  \d[S+] NAME          describe table, view, sequence, or index  \da[S] [PATTERN]     list aggregate functions  \db[+] [PATTERN]     list tablespaces  \dc[S] [PATTERN]     list conversions  \dC [PATTERN]        list casts  \dd [PATTERN]        show comment for object  \dd[S] [PATTERN]     list comments on objects  \dD[S] [PATTERN]     list domains  \des[+] [PATTERN]    list foreign servers  \deu[+] [PATTERN]    list user mappings  \dew[+] [PATTERN]    list foreign-data wrappers  \df[S+] [PATTERN]    list functions  \dF[+] [PATTERN]     list text search configurations  \dFd[+] [PATTERN]    list text search dictionaries  \dFp[+] [PATTERN]    list text search parsers  \dFt[+] [PATTERN]    list text search templates  \dg [PATTERN]        list roles (groups)  \di[S+] [PATTERN]    list indexes  \dl                  list large objects, same as \lo_list  \dn[+] [PATTERN]     list schemas  \do[S] [PATTERN]     list operators  \dp [PATTERN]        list table, view, and sequence access privileges    \z [PATTERN]       same as \dp  \ds[S+] [PATTERN]    list sequences  \dt[S+] [PATTERN]    list tables  \dT[S+] [PATTERN]    list data types  \du [PATTERN]        list roles (users)  \dv[S+] [PATTERN]    list views

--  Bruce Momjian          http://momjian.us EnterpriseDB                             http://enterprisedb.com
 + If your life is a hard drive, Christ can be your backup. +

Re: Re: [COMMITTERS] pgsql: This makes all the \dX commands (most importantly to most: \df)

От:
"Joshua D. Drake" <jd@commandprompt.com>
Дата:
On Tue, 2009-01-06 at 18:08 -0500, Bruce Momjian wrote:
> Bruce Momjian wrote:

> > I also found a bug that \do didn't work because the AND system table
> > check was being added to the LEFT JOIN and not to the WHERE clause
> > (trigger display was also a problem).
> 
> Let me also say that that \d* display is ready to fall over from its own
> weight:
> 
> 	Informational
> 	  Modifiers: S = show system objects  + = Additional detail
> 	  \l[+]                list all databases
> 	  \d[S+]               list tables, views, and sequences
> 	  \d[S+] NAME          describe table, view, sequence, or index
> 	  \da[S] [PATTERN]     list aggregate functions
> 	  \db[+] [PATTERN]     list tablespaces
> 	  \dc[S] [PATTERN]     list conversions

Hmmm, I wonder if it makes sense to make it four column instead of two
column.

Joshua D. Drake



-- 
PostgreSQL  Consulting, Development, Support, Training  503-667-4564 - http://www.commandprompt.com/  The PostgreSQL Company, serving since 1997


Re: Re: [COMMITTERS] pgsql: This makes all the \dX commands (most importantly to most: \df)

От:
Bruce Momjian <bruce@momjian.us>
Дата:
Joshua D. Drake wrote:
> On Tue, 2009-01-06 at 18:08 -0500, Bruce Momjian wrote:
> > Bruce Momjian wrote:
> 
> > > I also found a bug that \do didn't work because the AND system table
> > > check was being added to the LEFT JOIN and not to the WHERE clause
> > > (trigger display was also a problem).
> > 
> > Let me also say that that \d* display is ready to fall over from its own
> > weight:
> > 
> > 	Informational
> > 	  Modifiers: S = show system objects  + = Additional detail
> > 	  \l[+]                list all databases
> > 	  \d[S+]               list tables, views, and sequences
> > 	  \d[S+] NAME          describe table, view, sequence, or index
> > 	  \da[S] [PATTERN]     list aggregate functions
> > 	  \db[+] [PATTERN]     list tablespaces
> > 	  \dc[S] [PATTERN]     list conversions
> 
> Hmmm, I wonder if it makes sense to make it four column instead of two
> column.

You mean like this?
   fprintf(output, _("Informational\n"));   fprintf(output, _("  Modifiers: S = show system objects  + = Additional detail\n"));   fprintf(output, _("  \\l[+]                list all databases\n"));   fprintf(output, _("  \\d[S+]               list tables, views, and sequences\n"));   fprintf(output, _("  \\d[S+]   NAME        describe table, view, sequence, or index\n"));   fprintf(output, _("  \\da[S]   [PATTERN]   list aggregate functions\n"));   fprintf(output, _("  \\db[+]   [PATTERN]   list tablespaces\n"));   fprintf(output, _("  \\dc[S]   [PATTERN]   list conversions\n"));   fprintf(output, _("  \\dC      [PATTERN]   list casts\n"));   fprintf(output, _("  \\dd      [PATTERN]   show comment for object\n"));   fprintf(output, _("  \\dd[S]   [PATTERN]   list comments on objects\n"));   fprintf(output, _("  \\dD[S]   [PATTERN]   list domains\n"));   fprintf(output, _("  \\des[+]  [PATTERN]   list foreign servers\n"));   fprintf(output, _("  \\deu[+]  [PATTERN]   list user mappings\n"));   fprintf(output, _("  \\dew[+]  [PATTERN]   list foreign-data wrappers\n"));   fprintf(output, _("  \\df[S+]  [PATTERN]   list functions\n"));   fprintf(output, _("  \\dF[+]   [PATTERN]   list text search configurations\n"));   fprintf(output, _("  \\dFd[+]  [PATTERN]   list text search dictionaries\n"));   fprintf(output, _("  \\dFp[+]  [PATTERN]   list text search parsers\n"));   fprintf(output, _("  \\dFt[+]  [PATTERN]   list text search templates\n"));   fprintf(output, _("  \\dg      [PATTERN]   list roles (groups)\n"));   fprintf(output, _("  \\di[S+]  [PATTERN]   list indexes\n"));   fprintf(output, _("  \\dl                  list large objects, same as \\lo_list\n"));   fprintf(output, _("  \\dn[+]   [PATTERN]   list schemas\n"));   fprintf(output, _("  \\do[S]   [PATTERN]   list operators\n"));   fprintf(output, _("  \\dp      [PATTERN]   list table, view, and sequence access privileges\n"));   fprintf(output, _("   \\z      [PATTERN]   same as \\dp\n"));   fprintf(output, _("  \\ds[S+]  [PATTERN]   list sequences\n"));   fprintf(output, _("  \\dt[S+]  [PATTERN]   list tables\n"));   fprintf(output, _("  \\dT[S+]  [PATTERN]   list data types\n"));   fprintf(output, _("  \\du      [PATTERN]   list roles (users)\n"));   fprintf(output, _("  \\dv[S+]  [PATTERN]   list views\n"));   fprintf(output, "\n");

--  Bruce Momjian          http://momjian.us EnterpriseDB                             http://enterprisedb.com
 + If your life is a hard drive, Christ can be your backup. +

Re: Re: [COMMITTERS] pgsql: This makes all the \dX commands (most importantly to most: \df)

От:
Bruce Momjian <bruce@momjian.us>
Дата:
Bruce Momjian wrote:
> Joshua D. Drake wrote:
> > On Tue, 2009-01-06 at 18:08 -0500, Bruce Momjian wrote:
> > > Bruce Momjian wrote:
> > 
> > > > I also found a bug that \do didn't work because the AND system table
> > > > check was being added to the LEFT JOIN and not to the WHERE clause
> > > > (trigger display was also a problem).
> > > 
> > > Let me also say that that \d* display is ready to fall over from its own
> > > weight:
> > > 
> > > 	Informational
> > > 	  Modifiers: S = show system objects  + = Additional detail
> > > 	  \l[+]                list all databases
> > > 	  \d[S+]               list tables, views, and sequences
> > > 	  \d[S+] NAME          describe table, view, sequence, or index
> > > 	  \da[S] [PATTERN]     list aggregate functions
> > > 	  \db[+] [PATTERN]     list tablespaces
> > > 	  \dc[S] [PATTERN]     list conversions
> > 
> > Hmmm, I wonder if it makes sense to make it four column instead of two
> > column.

OK, done (below).  'list' seems kind of redundant.  Can we factor that
out somehow?
Informational  Modifiers: S = show system objects  + = Additional detail  \l[+]                 list all databases  \d[S+]                list tables, views, and sequences  \d[S+]   NAME         describe table, view, sequence, or index  \da[S]   [PATTERN]    list aggregate functions  \db[+]   [PATTERN]    list tablespaces  \dc[S]   [PATTERN]    list conversions  \dC      [PATTERN]    list casts  \dd      [PATTERN]    show comment for object  \dd[S]   [PATTERN]    list comments on objects  \dD[S]   [PATTERN]    list domains  \des[+]  [PATTERN]    list foreign servers  \deu[+]  [PATTERN]    list user mappings  \dew[+]  [PATTERN]    list foreign-data wrappers  \df[S+]  [PATTERN]    list functions  \dF[+]   [PATTERN]    list text search configurations  \dFd[+]  [PATTERN]    list text search dictionaries  \dFp[+]  [PATTERN]    list text search parsers  \dFt[+]  [PATTERN]    list text search templates  \dg      [PATTERN]    list roles (groups)  \di[S+]  [PATTERN]    list indexes  \dl                   list large objects, same as \lo_list  \dn[+]   [PATTERN]    list schemas  \do[S]   [PATTERN]    list operators  \dp      [PATTERN]    list table, view, and sequence access privileges   \z      [PATTERN]    same as \dp  \ds[S+]  [PATTERN]    list sequences  \dt[S+]  [PATTERN]    list tables  \dT[S+]  [PATTERN]    list data types  \du      [PATTERN]    list roles (users)  \dv[S+]  [PATTERN]    list views


--  Bruce Momjian          http://momjian.us EnterpriseDB                             http://enterprisedb.com
 + If your life is a hard drive, Christ can be your backup. +

Re: Re: [COMMITTERS] pgsql: This makes all the \dX commands (most importantly to most: \df)

От:
"Joshua D. Drake" <jd@commandprompt.com>
Дата:
On Tue, 2009-01-06 at 19:06 -0500, Bruce Momjian wrote:
> Bruce Momjian wrote:

> OK, done (below).  'list' seems kind of redundant.  Can we factor that
> out somehow?
> 
> 	Informational
> 	  Modifiers: S = show system objects  + = Additional detail
> 	  \l[+]                 list all databases
> 	  \d[S+]                list tables, views, and sequences
> 	  \d[S+]   NAME         describe table, view, sequence, or index
> 	  \da[S]   [PATTERN]    list aggregate functions
> 	  \db[+]   [PATTERN]    list tablespaces
> 	  \dc[S]   [PATTERN]    list conversions
> 	  \dC      [PATTERN]    list casts
> 	  \dd      [PATTERN]    show comment for object

Per offline comments my thoughts were something like:

Informational: S = show system objects  + = Additional detail
Display: \l[+]                all databases \d[S+]               tables, views, and sequences \d[S+]   NAME        describe table, view, sequence, or index \da[S]   [PATTERN]   aggregate functions \db[+]   [PATTERN]   tablespaces \dc[S]   [PATTERN]   conversions \dC      [PATTERN]   casts \dd      [PATTERN]   show comment for object \dd[S]   [PATTERN]   comments on objects


But I am not putting up any sandbags :)

Joshua D. Drake


> 
-- 
PostgreSQL  Consulting, Development, Support, Training  503-667-4564 - http://www.commandprompt.com/  The PostgreSQL Company, serving since 1997


Re: Re: [COMMITTERS] pgsql: This makes all the \dX commands (most importantly to most: \df)

От:
Bruce Momjian <bruce@momjian.us>
Дата:
Joshua D. Drake wrote:
> On Tue, 2009-01-06 at 19:06 -0500, Bruce Momjian wrote:
> > Bruce Momjian wrote:
> 
> > OK, done (below).  'list' seems kind of redundant.  Can we factor that
> > out somehow?
> > 
> > 	Informational
> > 	  Modifiers: S = show system objects  + = Additional detail
> > 	  \l[+]                 list all databases
> > 	  \d[S+]                list tables, views, and sequences
> > 	  \d[S+]   NAME         describe table, view, sequence, or index
> > 	  \da[S]   [PATTERN]    list aggregate functions
> > 	  \db[+]   [PATTERN]    list tablespaces
> > 	  \dc[S]   [PATTERN]    list conversions
> > 	  \dC      [PATTERN]    list casts
> > 	  \dd      [PATTERN]    show comment for object
> 
> Per offline comments my thoughts were something like:
> 
> Informational: S = show system objects  + = Additional detail
> Display:

I don't like the "Display:" here because it mimicks the heading above
it.

>   \l[+]                all databases
>   \d[S+]               tables, views, and sequences
>   \d[S+]   NAME        describe table, view, sequence, or index
>   \da[S]   [PATTERN]   aggregate functions
>   \db[+]   [PATTERN]   tablespaces
>   \dc[S]   [PATTERN]   conversions
>   \dC      [PATTERN]   casts
>   \dd      [PATTERN]   show comment for object
>   \dd[S]   [PATTERN]   comments on objects

--  Bruce Momjian          http://momjian.us EnterpriseDB                             http://enterprisedb.com
 + If your life is a hard drive, Christ can be your backup. +

Re: Re: [COMMITTERS] pgsql: This makes all the \dX commands (most importantly to most: \df)

От:
"Joshua D. Drake" <jd@commandprompt.com>
Дата:
On Tue, 2009-01-06 at 19:13 -0500, Bruce Momjian wrote:
> Joshua D. Drake wrote:
> > 
> > Per offline comments my thoughts were something like:
> > 
> > Informational: S = show system objects  + = Additional detail
> > Display:
> 
> I don't like the "Display:" here because it mimicks the heading above
> it.

Fair enough. I would be fine without it.

Joshua D. Drake


-- 
PostgreSQL  Consulting, Development, Support, Training  503-667-4564 - http://www.commandprompt.com/  The PostgreSQL Company, serving since 1997


Re: Re: [COMMITTERS] pgsql: This makes all the \dX commands (most importantly to most: \df)

От:
Alvaro Herrera <alvherre@commandprompt.com>
Дата:
Bruce Momjian wrote:

> 	Informational
> 	  Modifiers: S = show system objects  + = Additional detail
> 	  \l[+]                 list all databases
> 	  \d[S+]                list tables, views, and sequences
> 	  \d[S+]   NAME         describe table, view, sequence, or index
> 	  \da[S]   [PATTERN]    list aggregate functions

If we do this, is there a way to abstract the translation marker _()
from the alignment whitespace?

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

Re: Re: [COMMITTERS] pgsql: This makes all the \dX commands (most importantly to most: \df)

От:
"Joshua D. Drake" <jd@commandprompt.com>
Дата:
On Tue, 2009-01-06 at 21:58 -0300, Alvaro Herrera wrote:
> Bruce Momjian wrote:
> 
> > 	Informational
> > 	  Modifiers: S = show system objects  + = Additional detail
> > 	  \l[+]                 list all databases
> > 	  \d[S+]                list tables, views, and sequences
> > 	  \d[S+]   NAME         describe table, view, sequence, or index
> > 	  \da[S]   [PATTERN]    list aggregate functions
> 
> If we do this, is there a way to abstract the translation marker _()
> from the alignment whitespace?

O.k. I might just be stupid here but can we just seek until we hit a non
space or \t?

Joshua D. Drake


> 
> -- 
> Alvaro Herrera                                http://www.CommandPrompt.com/
> The PostgreSQL Company - Command Prompt, Inc.
> 
-- 
PostgreSQL  Consulting, Development, Support, Training  503-667-4564 - http://www.commandprompt.com/  The PostgreSQL Company, serving since 1997


Re: Re: [COMMITTERS] pgsql: This makes all the \dX commands (most importantly to most: \df)

От:
Bruce Momjian <bruce@momjian.us>
Дата:
Alvaro Herrera wrote:
> Bruce Momjian wrote:
> 
> > 	Informational
> > 	  Modifiers: S = show system objects  + = Additional detail
> > 	  \l[+]                 list all databases
> > 	  \d[S+]                list tables, views, and sequences
> > 	  \d[S+]   NAME         describe table, view, sequence, or index
> > 	  \da[S]   [PATTERN]    list aggregate functions
> 
> If we do this, is there a way to abstract the translation marker _()
> from the alignment whitespace?

So they don't have to re-translate?

--  Bruce Momjian          http://momjian.us EnterpriseDB                             http://enterprisedb.com
 + If your life is a hard drive, Christ can be your backup. +

Re: Re: [COMMITTERS] pgsql: This makes all the \dX commands (most importantly to most: \df)

От:
Alvaro Herrera <alvherre@commandprompt.com>
Дата:
Bruce Momjian wrote:
> Alvaro Herrera wrote:
> > Bruce Momjian wrote:
> > 
> > > 	Informational
> > > 	  Modifiers: S = show system objects  + = Additional detail
> > > 	  \l[+]                 list all databases
> > > 	  \d[S+]                list tables, views, and sequences
> > > 	  \d[S+]   NAME         describe table, view, sequence, or index
> > > 	  \da[S]   [PATTERN]    list aggregate functions
> > 
> > If we do this, is there a way to abstract the translation marker _()
> > from the alignment whitespace?
> 
> So they don't have to re-translate?

No, so that the translators don't have to worry about getting alignment
right; and also so that they don't have to translate \\d[S+] etc which
obviously doesn't need any translation.

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

Re: Re: [COMMITTERS] pgsql: This makes all the \dX commands (most importantly to most: \df)

От:
Bruce Momjian <bruce@momjian.us>
Дата:
Alvaro Herrera wrote:
> Bruce Momjian wrote:
> > Alvaro Herrera wrote:
> > > Bruce Momjian wrote:
> > > 
> > > > 	Informational
> > > > 	  Modifiers: S = show system objects  + = Additional detail
> > > > 	  \l[+]                 list all databases
> > > > 	  \d[S+]                list tables, views, and sequences
> > > > 	  \d[S+]   NAME         describe table, view, sequence, or index
> > > > 	  \da[S]   [PATTERN]    list aggregate functions
> > > 
> > > If we do this, is there a way to abstract the translation marker _()
> > > from the alignment whitespace?
> > 
> > So they don't have to re-translate?
> 
> No, so that the translators don't have to worry about getting alignment
> right; and also so that they don't have to translate \\d[S+] etc which
> obviously doesn't need any translation.

I am thinking we can do:
fprintf(output, "  \\da[S]   %.9s    %s\n", _("[PATTERN]"), 	_("list aggregate"));

What do you think?

--  Bruce Momjian          http://momjian.us EnterpriseDB                             http://enterprisedb.com
 + If your life is a hard drive, Christ can be your backup. +

Re: Re: [COMMITTERS] pgsql: This makes all the \dX commands (most importantly to most: \df)

От:
Alvaro Herrera <alvherre@commandprompt.com>
Дата:
Bruce Momjian wrote:
> Alvaro Herrera wrote:

> > No, so that the translators don't have to worry about getting alignment
> > right; and also so that they don't have to translate \\d[S+] etc which
> > obviously doesn't need any translation.
> 
> I am thinking we can do:
> 
> 	fprintf(output, "  \\da[S]   %.9s    %s\n", _("[PATTERN]"), 
> 		_("list aggregate"));
> 
> What do you think?

Right, something like that ... I'm wondering, though, if there are any
translations where [PATTERN] ends up longer than 9 chars.  At least none
of the existing translations has that problem, so it seems we're good ...

Hmm, what's the difference here:
 \dd      [PATTERN]    show comment for object \dd[S]   [PATTERN]    list comments on objects
?

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

Re: Re: [COMMITTERS] pgsql: This makes all the \dX commands (most importantly to most: \df)

От:
Bruce Momjian <bruce@momjian.us>
Дата:
Alvaro Herrera wrote:
> Bruce Momjian wrote:
> > Alvaro Herrera wrote:
> 
> > > No, so that the translators don't have to worry about getting alignment
> > > right; and also so that they don't have to translate \\d[S+] etc which
> > > obviously doesn't need any translation.
> > 
> > I am thinking we can do:
> > 
> > 	fprintf(output, "  \\da[S]   %.9s    %s\n", _("[PATTERN]"), 
> > 		_("list aggregate"));
> > 
> > What do you think?
> 
> Right, something like that ... I'm wondering, though, if there are any
> translations where [PATTERN] ends up longer than 9 chars.  At least none
> of the existing translations has that problem, so it seems we're good ...
> 

I probably should have suggested:
	fprintf(output, "  \\da[S]   %-12s %s\n", _("[PATTERN]"), 		_("list aggregate"));

I am hesistant to use -12.12 because that might cut off a long word, or
a bracket.

The larger question is how does printf(3) handle width, as bytes or
characters.  My Ubuntu says:
      If the converted value has fewer characters than the      field width, it will be padded with spaces  on  the  left      (or right, if the left-adjustment flag has been given).

This talks about characters, but is it really multibyte characters?
Alvaro says we have to use %ls, but he says that is wchar_t, which we
don't use.

> Hmm, what's the difference here:
> 
>   \dd      [PATTERN]    show comment for object
>   \dd[S]   [PATTERN]    list comments on objects

I don't know what you're talking about --- LOOK THERE! (removes duplicate
line while no one is looking)

--  Bruce Momjian          http://momjian.us EnterpriseDB                             http://enterprisedb.com
 + If your life is a hard drive, Christ can be your backup. +

FAQ