either create a postgres user named 'root' and give it superuser privileges,
In order to do that I need to connect to the database with my script
which is running under the root account.
or switch to a different method of authentication for LOCAL users
I am confused. I presumed the proper
Tim Uckun wrote:
This script is a part of the initial setup script for the server. It
has to run as root because when it starts running postgres is not
installed and there is no postgres user.
But afterwards, inside the script, you could use su to temporarily switch to
a less
On Sunday 08 November 2009 10:48:49 pm Tim Uckun wrote:
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
That's what I
Tim Uckun wrote:
either create a postgres user named 'root' and give it superuser privileges,
In order to do that I need to connect to the database with my script
which is running under the root account.
if you are root, use
su -c psql -f /path/to/script.sql postgres
or
But afterwards, inside the script, you could use su to temporarily switch to
a less priviledged user:
... commands running as root
su postgres -c 'psql ' # running as postgres
... running as root again
OK I will try this.
I am very confused about something though. Not one person here
authenication type is controlled via the pg_hba.conf file.
frankly, I've never used the pg_ident file, it just seems like it would add
more confusion to things. But, it appears to use it you need a
map=/mapname/ primitive in your pg_hba.conf
That's why I attempted to do. I read the
Tim Uckun wrote:
I am very confused about something though. Not one person here has
said anything about how pg_ident works or what I did wrong. Is
pg_ident deprecated? Is there no way to accomplish this with pg_ident?
I just tried with 8.4.1. Started with the default configuration,
- Daniel Verite dan...@manitou-mail.org wrote:
Tim Uckun wrote:
I am very confused about something though. Not one person here has
said anything about how pg_ident works or what I did wrong. Is
pg_ident deprecated? Is there no way to accomplish this with
pg_ident?
I just
I just tried with 8.4.1. Started with the default configuration, created
data/pg_ident.conf with:
pg_map root postgres
pg_map postgres postgres
Replaced in pg_hba.conf:
local all all trust
by
local all all
Tim Uckun timuc...@gmail.com writes:
I am sad to report that this does not work with ubuntu 9.04 postgres
8.3 installed from the packages. I have removed everything from
pg_hba.conf except for the one line what says
localallall ident map=pg_map
I want to accomplish what I would think would be a simple thing. I
want the root user to be able to connect to the postgres database as
user postgres from the local machine without passwords. Since I am
doing this from a program I don't want to use the su facility.
I have tried a lot of
Tim Uckun timuc...@gmail.com writes:
I want to accomplish what I would think would be a simple thing. I
want the root user to be able to connect to the postgres database as
user postgres from the local machine without passwords. Since I am
doing this from a program I don't want to use the su
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
On Sun, Nov 8, 2009 at 9:08 PM, Tim Uckun timuc...@gmail.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.
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
That's what I am trying to get working. In actuality I am using ruby
and
Tim Uckun wrote:
psql -U postgres
psql: FATAL: Ident authentication failed for user postgres
Obviously I need to tell postgres to trust the user root when
connected locally as postgres.
How do I do that?
either create a postgres user named 'root' and give it superuser
privileges, or
16 matches
Mail list logo