Subject: Omission of "(or C)" in psql's "pset title" header

From: "David G. Johnston" <[email-masked]>
Date: Wed, 24 Jun 2015 18:11:20 -0400

http://www.postgresql.org/docs/devel/static/app-psql.html

The other pset keywords with black-slash aliases include a "(or <letter>)"
paren after the keyword.  "title" does not (should be "C")

David J.

---

From: Monica Gamazo <[email-masked]>
Date: Tue, 30 Jun 2015 00:09:18 +0000 (UTC)

use my whatsapp 593987847535  Atte.Ing. Mónica GamazoIngeniera en Sistemas Computacionales
GAMAZO_SYS
Celular: 0987847535
skype: monicagamazo
Pagina web: http://www.computrabajo.com.ec/cvs/gamazosys 

     El Miércoles 24 de junio de 2015 17:12, David G. Johnston <[email-masked]> escribió:

The other pset keywords with black-slash aliases include a "(or <letter>)" paren after the keyword.  "title" does not (should be "C")
David J.

---

From: Monica Gamazo <[email-masked]>
Date: Tue, 30 Jun 2015 00:11:26 +0000 (UTC)

all commands are used in operative system linux or unix  Atte.Ing. Mónica GamazoIngeniera en Sistemas Computacionales
GAMAZO_SYS
Celular: 0987847535
skype: monicagamazo
Pagina web: http://www.computrabajo.com.ec/cvs/gamazosys

---

From: Bruce Momjian <[email-masked]>
Date: Wed, 26 Aug 2015 22:02:26 -0400

> paren after the keyword.  "title" does not (should be "C")

Attached is a patch to implement this, including a doc patch.

-- 
  Bruce Momjian  <[email-masked]>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + Everyone has their own god. +
diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
new file mode 100644
index f996865..9361591
*** a/doc/src/sgml/ref/psql-ref.sgml
--- b/doc/src/sgml/ref/psql-ref.sgml
*************** lo_import 152801
*** 2336,2342 ****
            </varlistentry>
  
            <varlistentry>
!           <term><literal>title</literal></term>
            <listitem>
            <para>
            Sets the table title for any subsequently printed tables. This
--- 2336,2342 ----
            </varlistentry>
  
            <varlistentry>
!           <term><literal>title</literal> (or <literal>C</literal>)</term>
            <listitem>
            <para>
            Sets the table title for any subsequently printed tables. This
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c
new file mode 100644
index 6181a61..293c520
*** a/src/bin/psql/command.c
--- b/src/bin/psql/command.c
*************** do_pset(const char *param, const char *v
*** 2636,2642 ****
  	}
  
  	/* set title override */
! 	else if (strcmp(param, "title") == 0)
  	{
  		free(popt->title);
  		if (!value)
--- 2636,2642 ----
  	}
  
  	/* set title override */
! 	else if (strcmp(param, "C") == 0 || strcmp(param, "title") == 0)
  	{
  		free(popt->title);
  		if (!value)
*************** printPsetInfo(const char *param, struct
*** 2836,2842 ****
  	}
  
  	/* show title override */
! 	else if (strcmp(param, "title") == 0)
  	{
  		if (popt->title)
  			printf(_("Title is \"%s\".\n"), popt->title);
--- 2836,2842 ----
  	}
  
  	/* show title override */
! 	else if (strcmp(param, "C") == 0 || strcmp(param, "title") == 0)
  	{
  		if (popt->title)
  			printf(_("Title is \"%s\".\n"), popt->title);

-- 
Sent via pgsql-docs mailing list ([email-masked])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs

---

From: "David G. Johnston" <[email-masked]>
Date: Wed, 26 Aug 2015 22:51:09 -0400

> Attached is a patch to implement this, including a doc patch.
​Wasn't expecting a code change - just the docs.  The docs already said the
"\C [ title ]" is a valid meta-command...

Did you maybe end up making a command line "-C 'title'" valid instead?

David J.

---

From: Bruce Momjian <[email-masked]>
Date: Thu, 27 Aug 2015 11:13:52 -0400

On Wed, Aug 26, 2015 at 10:51:09PM -0400, David G. Johnston wrote:
> ​Wasn't expecting a code change - just the docs.  The docs already said the "\C
> [ title ]" is a valid meta-command...
> 

Obviously I am not understanding you. I thought you were looking for
\pset C to be documented, and to work:

	test=> \pset C test
	Title is "test".

That does not work in the current sources, so I had to add it.  This is
similar to how "\pset t" works as an alias for "\pset tuples_only":

	test=> \pset t
	Tuples only is on.

When our docs say:

    <term><literal>tuples_only</literal> (or <literal>t</literal>)</term>

it is not talking about using \t, but rather "\pset t" --- perhaps that
is where the confusion is coming from.  (Yeah, I know it is kind of
odd.)

---

From: "David G. Johnston" <[email-masked]>
Date: Thu, 27 Aug 2015 11:50:53 -0400

On Thu, Aug 27, 2015 at 11:13 AM, Bruce Momjian <[email-masked]> wrote:

> >     > The other pset keywords with black-slash aliases include a "(or
> <letter>)
> >     "
​Yes, I read that as "\pset tuples_only" and "\t" are alternate forms of
the same thing
​ and thought that "\pset title" and "\C" should be documented similarly.
Making "\pset C <label>" work doesn't seem like an improvement.

David J.

---

From: Bruce Momjian <[email-masked]>
Date: Thu, 27 Aug 2015 12:06:29 -0400

On Thu, Aug 27, 2015 at 11:50:53AM -0400, David G. Johnston wrote:
> ​Yes, I read that as "\pset tuples_only" and "\t" are alternate forms of the
> same thing

Well, making \pset C is at least consistent.  We can't say "or C"
without it.

---

From: "David G. Johnston" <[email-masked]>
Date: Thu, 27 Aug 2015 12:16:22 -0400

On Thursday, August 27, 2015, Bruce Momjian <[email-masked]> wrote:

> the
Agreed.

---

From: Bruce Momjian <[email-masked]>
Date: Mon, 5 Oct 2015 20:56:54 -0400

> Attached is a patch to implement this, including a doc patch.

Patch applied.

+ As you are, so once was I. As I am, so you will be. +
+ Roman grave inscription                             +