Re: I can't seem to put the right combination of magic into the pg_hba and pg_ident files.

From: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
To: Tim Uckun <timuckun(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: I can't seem to put the right combination of magic into the pg_hba and pg_ident files.
Date: 2009-11-09 06:27:08
Message-ID: dcc563d10911082227n71dd661dk7074aff8957869ea@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sun, Nov 8, 2009 at 9:08 PM, Tim Uckun <timuckun(at)gmail(dot)com> wrote:
>> I suspect you are expecting that the map will cause root to be
>> logged in as postgres without asking for that.  It won't.
>> What it will do is allow "psql -U postgres" and similar to work.
>
> That's exactly what I am looking to do. In my case I have a script
> that runs as root. I want to log in as postgres user from that script
> but the script is running as root.
>
> The way I have it set up doesn't permit that. I want to know what I
> need to do in order to make that happen.

then say you're postgres in the script with the -U (if you're using psql)

AS ROOT:
psql -U postgres -h remote_db dbname

Note that ident doesn't work so well between machines, so you might
want to look at .pgpass

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tim Uckun 2009-11-09 06:48:49 Re: I can't seem to put the right combination of magic into the pg_hba and pg_ident files.
Previous Message Jukka Inkeri 2009-11-09 05:15:22 Re: Problem to use remote cygwin server using ssh and native psql 8.3.5