Thread

  1. .psqlrc output for \pset commands

    Bruce Momjian <bruce@momjian.us> — 2008-06-11T23:24:16Z

    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@momjian.us>        http://momjian.us
      EnterpriseDB                             http://enterprisedb.com
    
      + If your life is a hard drive, Christ can be your backup. +
    
    
  2. Re: .psqlrc output for \pset commands

    Gregory Stark <stark@enterprisedb.com> — 2008-06-12T00:23:31Z

    "Bruce Momjian" <bruce@momjian.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!
    
    
  3. Re: .psqlrc output for \pset commands

    Tom Lane <tgl@sss.pgh.pa.us> — 2008-06-12T02:05:39Z

    Gregory Stark <stark@enterprisedb.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
    
    
  4. Re: .psqlrc output for \pset commands

    Peter Eisentraut <peter_e@gmx.net> — 2008-06-12T15:01:20Z

    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!
    
    
    
    
  5. Re: .psqlrc output for \pset commands

    Neil Conway <neilc@samurai.com> — 2008-06-12T18:10:12Z

    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
    
    
    
    
  6. Re: .psqlrc output for \pset commands

    Bruce Momjian <bruce@momjian.us> — 2008-06-12T18:19:04Z

    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@momjian.us>        http://momjian.us
      EnterpriseDB                             http://enterprisedb.com
    
      + If your life is a hard drive, Christ can be your backup. +
    
    
  7. Re: .psqlrc output for \pset commands

    Peter Eisentraut <peter_e@gmx.net> — 2008-06-15T22:29:36Z

    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.
    
    
  8. Re: .psqlrc output for \pset commands

    Bruce Momjian <bruce@momjian.us> — 2008-07-17T00:44:36Z

    Gregory Stark wrote:
    > "Bruce Momjian" <bruce@momjian.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@momjian.us>        http://momjian.us
      EnterpriseDB                             http://enterprisedb.com
    
      + If your life is a hard drive, Christ can be your backup. +
    
  9. Re: .psqlrc output for \pset commands

    Bruce Momjian <bruce@momjian.us> — 2008-07-18T17:20:16Z

    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@momjian.us>        http://momjian.us
      EnterpriseDB                             http://enterprisedb.com
    
      + If your life is a hard drive, Christ can be your backup. +
    
    
  10. Re: .psqlrc output for \pset commands

    Peter Eisentraut <peter_e@gmx.net> — 2008-07-19T23:16:50Z

    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.
    
    
  11. Re: .psqlrc output for \pset commands

    Bruce Momjian <bruce@momjian.us> — 2008-07-20T06:08:57Z

    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@momjian.us>        http://momjian.us
      EnterpriseDB                             http://enterprisedb.com
    
      + If your life is a hard drive, Christ can be your backup. +