pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
psql output and password Qs
2+ messages / 2 participants
[nested] [flat]

* psql output and password Qs
@ 2003-09-19 18:47 ow <oneway_111@yahoo.com>
  2003-09-19 20:56 ` Re: psql output and password Qs Oliver Elphick <olly@lfix.co.uk>
  0 siblings, 1 reply; 2+ messages in thread

From: ow @ 2003-09-19 18:47 UTC (permalink / raw)
  To: pgsql-sql

Hi,

1) When psql is run from a script, how would one save *all* output generated by
psql (including errors, info messages, etc) in to a file?. I tried redirecting
output with ">" but that did not save error/confirmation messages.

2) When psql is run from a script, how would one pass a password to psql?

Thanks








__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: psql output and password Qs
  2003-09-19 18:47 psql output and password Qs ow <oneway_111@yahoo.com>
@ 2003-09-19 20:56 ` Oliver Elphick <olly@lfix.co.uk>
  0 siblings, 0 replies; 2+ messages in thread

From: Oliver Elphick @ 2003-09-19 20:56 UTC (permalink / raw)
  To: ow <oneway_111@yahoo.com>; +Cc: pgsql-sql

On Fri, 2003-09-19 at 19:47, ow wrote:
> Hi,
> 
> 1) When psql is run from a script, how would one save *all* output generated by
> psql (including errors, info messages, etc) in to a file?. I tried redirecting
> output with ">" but that did not save error/confirmation messages.

Standard output and standard error are different streams.

The normal way to do what you want (Bourne shell syntax) is:

   psql ... >outfile 2>&1

> 2) When psql is run from a script, how would one pass a password to psql?

Create a .pgpass file to read it from (see the manual for details).

-- 
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight, UK                             http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
                 ========================================
     "Bring ye all the tithes into the storehouse, that 
      there may be meat in mine house, and prove me now 
      herewith, saith the LORD of hosts, if I will not open 
      you the windows of heaven, and pour you out a  
      blessing, that there shall not be room enough to  
      receive it."           Malachi 3:10 




^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2003-09-19 20:56 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-09-19 18:47 psql output and password Qs ow <oneway_111@yahoo.com>
2003-09-19 20:56 ` Oliver Elphick <olly@lfix.co.uk>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox