On Tue, 2007-10-30 at 12:05 +0100, Tronn Wærdahl wrote:
> I have a shell script (sh) where I create a user and import data to a
> postgres database
>
>
> su -c "createuser -A -D -P $PG_user" postgres
> su -c "psql -d$PG_database -h localhost -U$PG_user -W -f
> postgresql.sql " postgres
>
>
> wh
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 10/30/07, Tronn Wærdahl wrote:
>
> PG_passwd=secret
> PG_user =username
> PG_database=simple
>
sudo and .pgpass would be better, but for future reference, just
source the file in your script.
#!/bin/sh
source $HOME/.mypgvars
Now your PG_* vari
On Tue, 2007-10-30 at 12:37 +0100, Tronn Wærdahl wrote:
> Yes that is a possiblity, Joachim I dont see how this can be
> accomplished with sudo, could you provide some example syntax
You could use the environment variable PGPASSWORD to connect to the
database without entering the password.
Or y
On 10/30/07, Clint Dilks <[EMAIL PROTECTED]> wrote:
>
> You could set up the User so that no password is required from Localhost
> if that is appropriate
>
>
> Tronn Wærdahl wrote:
> > I have a shell script (sh) where I create a user and import data to a
> > postgres database
> >
> >
> > su -c "cr
You could set up the User so that no password is required from Localhost
if that is appropriate
Tronn Wærdahl wrote:
I have a shell script (sh) where I create a user and import data to a
postgres database
su -c "createuser -A -D -P $PG_user" postgres
su -c "psql -d$PG_database -h localhost
Tronn Wærdahl wrote:
I have a shell script (sh) where I create a user and import data to a
postgres database
su -c "createuser -A -D -P $PG_user" postgres
su -c "psql -d$PG_database -h localhost -U$PG_user -W -f postgresql.sql
" postgres
I think, the usage of sudo would solve your proble
6 matches
Mail list logo