Re: psql copy from through bash - Mailing list pgsql-general

From Pavel Stehule
Subject Re: psql copy from through bash
Date
Msg-id CAFj8pRBErMAxfenKLNE9PfkNx+jYi9LMjbs153usUfrGb-_5iQ@mail.gmail.com
Whole thread Raw
In response to Re: psql copy from through bash  (Szymon Guz <mabewlun@gmail.com>)
List pgsql-general
Hello

>>
>> Once more quickie. It seems that I am going to be asked for my password
>> every time psql loops through the copy statement.
>>
>> What is considered best practices to handle authentication? I am
>> connecting locally, as myself as the user and I'm being asked for my user
>> password. I added the -w (no-password) to the psql statement, but now assume
>> I need to add a .pgpass file or something.
>>
>> Suggestions?
>>
>
> Add the password to ~/.pgpass
> http://www.postgresql.org/docs/9.1/static/libpq-pgpass.html

or

PGPASSWORD=mypassword psql database -c "copy ..."

Regards

Pavel
>
> Szymon


pgsql-general by date:

Previous
From: Szymon Guz
Date:
Subject: Re: psql copy from through bash
Next
From: Jerry Sievers
Date:
Subject: Re: psql copy from through bash