pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Scripts Importing and Authentication
2+ messages / 2 participants
[nested] [flat]

* Scripts Importing and Authentication
@ 2004-02-05 19:47  Enio Schutt Junior <enio@pmpf.rs.gov.br>
  0 siblings, 1 reply; 2+ messages in thread

From: Enio Schutt Junior @ 2004-02-05 19:47 UTC (permalink / raw)
  To: pgsql-admin

The Postgresql I use is configured to authenticate users via md5 
(trust option in pg_hba.conf file) 
 
These days, after pg_dump'ing a database, and then reimporting it, 
Postgresql asks for the password of every user which is described 
by the \connect command in the script. I have used the environment 
variables PGUSER and PGPASSWORD, but they work for only one user, 
and the script has about 4 users in it and I don't know which 
one of them Postgres wants to know, because it only shows the 
prompt saying 'password:' and nothing more. 
 
So, is there a way of making the import of a script without 
having to supply passwords of all different users contained 
in that script? (I haven't done that, I have disabled the 
authentication)  
Is there a way of making it without disabling the authentication? 
 
Thanks. 



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

* Re: Scripts Importing and Authentication
@ 2004-02-07 06:20  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Enio Schutt Junior <enio@pmpf.rs.gov.br>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2004-02-07 06:20 UTC (permalink / raw)
  To: enio@pmpf.rs.gov.br; +Cc: pgsql-admin

"Enio Schutt Junior" <enio@pmpf.rs.gov.br> writes:
> So, is there a way of making the import of a script without 
> having to supply passwords of all different users contained 
> in that script?

You want the script to use SET SESSION AUTHORIZATION instead of
\connect.  As of PG 7.4 this is the default; for a release or two
beforehand, there's some arcane option you can specify to pg_dump.

			regards, tom lane



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


end of thread, other threads:[~2004-02-07 06:20 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-02-05 19:47 Scripts Importing and Authentication Enio Schutt Junior <enio@pmpf.rs.gov.br>
2004-02-07 06:20 ` Tom Lane <tgl@sss.pgh.pa.us>

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