Обсуждение: FW: backup using pg_dump postgreSQL 8.3.8

Поиск
Список
Период
Сортировка

FW: backup using pg_dump postgreSQL 8.3.8

От
"Sandy Test"
Дата:

 

We have postgreSQL 8.3.8 installed on a windows 8 server (64 bit).

 

We want to be able to run a nightly backup using the pg_dump command.

Unfortunately, even with the pg_hba.conf fix of adding host postgres … trust,

It still asks for a password.

 

1. Is this a 64bit issue? If the server was 32bit, would it not ask for a password?

 

2. Is there a way of running a dos script that would run the pg_dump providing a password when prompted?

 

3. Is there a way of running the pg_dump with a user that doesn't have a password?

 

Thanks

 

Sandy Test

System Manager Makhteshim

IT

Makhteshim Agan Group

tel:972-8-6296823   fax:972-8-6296043

sandy.test@ma-industries.com

 

Re: FW: backup using pg_dump postgreSQL 8.3.8

От
Andrew Sullivan
Дата:
On Wed, Mar 09, 2011 at 03:58:20PM +0200, Sandy Test wrote:
>
> We want to be able to run a nightly backup using the pg_dump command.
>
> Unfortunately, even with the pg_hba.conf fix of adding host postgres ...
> trust,
>
> It still asks for a password.

pg_hba sometimes surprises people because of its matching rules.  If
there's another entry that matches before the explicit postgres entry,
that's the rule you're going to get:

    The first record with a matching connection type, client address,
    requested database, and user name is used to perform
    authentication. There is no "fall-through" or "backup": if one
    record is chosen and the authentication fails, subsequent records
    are not considered. If no record matches, access is denied.

(http://www.postgresql.org/docs/9.0/interactive/auth-pg-hba-conf.html).
Are you sure that's not your problem.  (It always is for me, and I
always make this mistake at least once per installation, even after
many years.)

A

--
Andrew Sullivan
ajs@crankycanuck.ca

Re: FW: backup using pg_dump postgreSQL 8.3.8

От
Adrian Klaver
Дата:
On Wednesday, March 09, 2011 5:58:20 am Sandy Test wrote:
>
>
>
>
> 2. Is there a way of running a dos script that would run the pg_dump
> providing a password when prompted?

Using .pgpass
http://www.postgresql.org/docs/9.0/static/libpq-pgpass.html



>
>
>
> Thanks
>
>
>
> Sandy Test
>
--
Adrian Klaver
adrian.klaver@gmail.com

Re: FW: backup using pg_dump postgreSQL 8.3.8

От
Tom Lane
Дата:
Andrew Sullivan <ajs@crankycanuck.ca> writes:
> On Wed, Mar 09, 2011 at 03:58:20PM +0200, Sandy Test wrote:
>> We want to be able to run a nightly backup using the pg_dump command.
>>
>> Unfortunately, even with the pg_hba.conf fix of adding host postgres ...
>> trust,
>>
>> It still asks for a password.

> pg_hba sometimes surprises people because of its matching rules.

If it is asking for a password, and password authentication is what's
supposed to be used, then pg_hba is not where the problem is.  What
I think is that the OP has placed his client-side pgpass file in the
wrong place, or given it the wrong name, or the wrong permissions,
or the wrong contents.

I'm not too sure what the right name or place is on Windows, though,
so I have to defer to those who use that platform for more detailed
help.

            regards, tom lane

Re: FW: backup using pg_dump postgreSQL 8.3.8

От
Andrew Sullivan
Дата:
On Wed, Mar 09, 2011 at 10:31:56AM -0500, Tom Lane wrote:
> Andrew Sullivan <ajs@crankycanuck.ca> writes:
> > On Wed, Mar 09, 2011 at 03:58:20PM +0200, Sandy Test wrote:

> >> Unfortunately, even with the pg_hba.conf fix of adding host postgres ...
> >> trust,

> If it is asking for a password, and password authentication is what's
> supposed to be used, then pg_hba is not where the problem is.

Yes, but I think the OP was saying that the setting was moved to
trust.  My point was just that adding a trust entry isn't enough if
there's an earlier password entry.

I agree that .pgpass is probably the desired answer anyway.

A

--
Andrew Sullivan
ajs@crankycanuck.ca