Re: .psqlrc output for \pset commands

Lists: pgsql-hackers
From: Bruce Momjian <bruce(at)momjian(dot)us>
To: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: .psqlrc output for \pset commands
Date: 2008-06-11 23:24:16
Message-ID: 200806112324.m5BNOG624304@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

In my .psqlrc I have:

\pset format wrapped

and this outputs this on psql startup:

$ psql test
--> Output format is wrapped.
psql (8.4devel)
Type "help" for help.

Is this desirable? \set QUIET at the top of .psqlrc fixes it, but I am
wondering if we should be automatically doing quiet while .psqlrc is
processed.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +


From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: "Bruce Momjian" <bruce(at)momjian(dot)us>
Cc: "PostgreSQL-development" <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: .psqlrc output for \pset commands
Date: 2008-06-12 00:23:31
Message-ID: 87skvj4i2k.fsf@oxford.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

"Bruce Momjian" <bruce(at)momjian(dot)us> writes:

> In my .psqlrc I have:
>
> \pset format wrapped
>
> and this outputs this on psql startup:
>
> $ psql test
> --> Output format is wrapped.
> psql (8.4devel)
> Type "help" for help.
>
> Is this desirable? \set QUIET at the top of .psqlrc fixes it, but I am
> wondering if we should be automatically doing quiet while .psqlrc is
> processed.

I was wondering about this myself, but I'm still not used to the new banner.
It seems kind of... curt. Perhaps it should just be a single line instead of
two lines both around 20 characters...

Anyways the thing that struck me as odd was the messages appearing *before*
the header. It seems to me the header should print followed by .psqlrc output
followed by normal output.

--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com
Ask me about EnterpriseDB's Slony Replication support!


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Gregory Stark <stark(at)enterprisedb(dot)com>
Cc: "Bruce Momjian" <bruce(at)momjian(dot)us>, "PostgreSQL-development" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: .psqlrc output for \pset commands
Date: 2008-06-12 02:05:39
Message-ID: 28978.1213236339@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Gregory Stark <stark(at)enterprisedb(dot)com> writes:
> Anyways the thing that struck me as odd was the messages appearing *before*
> the header. It seems to me the header should print followed by .psqlrc output
> followed by normal output.

I think the reason for the current behavior is to allow \set QUIET in
.psqlrc to affect the printing of the banner. Are we prepared to
give that up?

regards, tom lane


From: "Peter Eisentraut" <peter_e(at)gmx(dot)net>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Gregory Stark" <stark(at)enterprisedb(dot)com>, "Bruce Momjian" <bruce(at)momjian(dot)us>, "PostgreSQL-development" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: .psqlrc output for \pset commands
Date: 2008-06-12 15:01:20
Message-ID: 1116.80.221.48.56.1213282880.squirrel@mail.pezone.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Tom Lane wrote:
> I think the reason for the current behavior is to allow \set QUIET in
> .psqlrc to affect the printing of the banner. Are we prepared to
> give that up?

I'm using that behavior!


From: Neil Conway <neilc(at)samurai(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: .psqlrc output for \pset commands
Date: 2008-06-12 18:10:12
Message-ID: 1213294212.14798.32.camel@dell.linuxdev.us.dell.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Wed, 2008-06-11 at 19:24 -0400, Bruce Momjian wrote:
> Is this desirable? \set QUIET at the top of .psqlrc fixes it, but I am
> wondering if we should be automatically doing quiet while .psqlrc is
> processed.

There is some precedent for not emitting the messages: most Unix tools
don't echo the results of applying their .rc files at startup.
Personally, I run psql frequently but very rarely modify my .psqlrc, so
seeing "timing is on" and similar messages echoed to the screen is
almost always noise.

-Neil


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Neil Conway <neilc(at)samurai(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: .psqlrc output for \pset commands
Date: 2008-06-12 18:19:04
Message-ID: 200806121819.m5CIJ4l20087@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Neil Conway wrote:
> On Wed, 2008-06-11 at 19:24 -0400, Bruce Momjian wrote:
> > Is this desirable? \set QUIET at the top of .psqlrc fixes it, but I am
> > wondering if we should be automatically doing quiet while .psqlrc is
> > processed.
>
> There is some precedent for not emitting the messages: most Unix tools
> don't echo the results of applying their .rc files at startup.
> Personally, I run psql frequently but very rarely modify my .psqlrc, so
> seeing "timing is on" and similar messages echoed to the screen is
> almost always noise.

Yea, that was really my point --- our current behavior doesn't match the
way most Unix tools behave when executing startup files.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Neil Conway <neilc(at)samurai(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>
Subject: Re: .psqlrc output for \pset commands
Date: 2008-06-15 22:29:36
Message-ID: 200806160029.38144.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Neil Conway wrote:
> There is some precedent for not emitting the messages: most Unix tools
> don't echo the results of applying their .rc files at startup.

Unix shells do echo the output generated by the startup files. It's just that
most Unix tools don't generate that much output.


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Gregory Stark <stark(at)enterprisedb(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: .psqlrc output for \pset commands
Date: 2008-07-17 00:44:36
Message-ID: 200807170044.m6H0ia517504@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Gregory Stark wrote:
> "Bruce Momjian" <bruce(at)momjian(dot)us> writes:
>
> > In my .psqlrc I have:
> >
> > \pset format wrapped
> >
> > and this outputs this on psql startup:
> >
> > $ psql test
> > --> Output format is wrapped.
> > psql (8.4devel)
> > Type "help" for help.
> >
> > Is this desirable? \set QUIET at the top of .psqlrc fixes it, but I am
> > wondering if we should be automatically doing quiet while .psqlrc is
> > processed.
>
> I was wondering about this myself, but I'm still not used to the new banner.
> It seems kind of... curt. Perhaps it should just be a single line instead of
> two lines both around 20 characters...
>
> Anyways the thing that struck me as odd was the messages appearing *before*
> the header. It seems to me the header should print followed by .psqlrc output
> followed by normal output.

Do you like this better?

$ psql test
psql (8.4devel)
Type "help" for help.
Output format is wrapped.

test=>

The attached patch accomplishes this.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

Attachment Content-Type Size
/pgpatches/psql text/x-diff 1.1 KB

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Gregory Stark <stark(at)enterprisedb(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: .psqlrc output for \pset commands
Date: 2008-07-18 17:20:16
Message-ID: 200807181720.m6IHKGi18912@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Bruce Momjian wrote:
> > > $ psql test
> > > --> Output format is wrapped.
> > > psql (8.4devel)
> > > Type "help" for help.
> > >
> > > Is this desirable? \set QUIET at the top of .psqlrc fixes it, but I am
> > > wondering if we should be automatically doing quiet while .psqlrc is
> > > processed.
> >
> > I was wondering about this myself, but I'm still not used to the new banner.
> > It seems kind of... curt. Perhaps it should just be a single line instead of
> > two lines both around 20 characters...
> >
> > Anyways the thing that struck me as odd was the messages appearing *before*
> > the header. It seems to me the header should print followed by .psqlrc output
> > followed by normal output.
>
> Do you like this better?
>
> $ psql test
> psql (8.4devel)
> Type "help" for help.
> Output format is wrapped.
>
> test=>
>
> The attached patch accomplishes this.

With no feedback, applied. ;-)

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, Gregory Stark <stark(at)enterprisedb(dot)com>
Subject: Re: .psqlrc output for \pset commands
Date: 2008-07-19 23:16:50
Message-ID: 200807200216.51457.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Am Thursday, 17. July 2008 schrieb Bruce Momjian:

> > Anyways the thing that struck me as odd was the messages appearing
> > *before* the header. It seems to me the header should print followed by
> > .psqlrc output followed by normal output.
>
> Do you like this better?
>
> $ psql test
> psql (8.4devel)
> Type "help" for help.
> Output format is wrapped.
>
> test=>
>
> The attached patch accomplishes this.

The psqlrc file must be read before the welcome message is printed, so that
you can disable the welcome message in the psqlrc file. Otherwise we are
reopening the whole issue of when and whether to print a welcome message that
we had just settled.


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org, Gregory Stark <stark(at)enterprisedb(dot)com>
Subject: Re: .psqlrc output for \pset commands
Date: 2008-07-20 06:08:57
Message-ID: 200807200608.m6K68vd03139@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Peter Eisentraut wrote:
> Am Thursday, 17. July 2008 schrieb Bruce Momjian:
>
> > > Anyways the thing that struck me as odd was the messages appearing
> > > *before* the header. It seems to me the header should print followed by
> > > .psqlrc output followed by normal output.
> >
> > Do you like this better?
> >
> > $ psql test
> > psql (8.4devel)
> > Type "help" for help.
> > Output format is wrapped.
> >
> > test=>
> >
> > The attached patch accomplishes this.
>
> The psqlrc file must be read before the welcome message is printed, so that
> you can disable the welcome message in the psqlrc file. Otherwise we are
> reopening the whole issue of when and whether to print a welcome message that
> we had just settled.

Oh, yea, sorry. Reverted.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +