From: dima <_pppp@mail.ru>
To: Artur Pietruk <arturp@plukwa.pdi.net>
Cc: pgsql-admin@postgresql.org
Subject: Re: dumping a password-protected db from a perl script or
Date: Mon, 04 Nov 2002 18:18:46 +0300
Message-ID: <3DC68FD6.5060504@mail.ru> (raw)
References: <3DC676F6.9060900@mail.ru>
<20021104151205.GK3354@yoda.plukwa.net>
>>How can i dump a password-protected database using perl (DBI or pg) or C
>>(using libpq)? I can't pass the password to pg_dump utility (I was
>>trying to pass it via tty also) when running system() from perl.
>
>
> Isn't example below something like what you are trying to do:
>
> ====8<====
> #include <stdio.h>
> #include <stdlib.h>
>
> int main(void) {
> system("export PGDATABASE=\"test\"; export PGPASSWORD=\"test\"; export PGUSER=\"test\"; psql");
>
> exit(0);
> }
> ====8<====
>
> ? Here psql should connect to db 'test' as user 'test', password
> 'test'. Check if it works with pg_dump.
This doesn't work on my 7.2.1 installation :/
I need to run pg_dump actually.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: _pppp@mail.ru, arturp@plukwa.pdi.net
Subject: Re: dumping a password-protected db from a perl script or
In-Reply-To: <3DC68FD6.5060504@mail.ru>
References: <3DC676F6.9060900@mail.ru> <20021104151205.GK3354@yoda.plukwa.net> <3DC68FD6.5060504@mail.ru>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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