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

2009-11-09 Thread Tim Uckun
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

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

2009-11-09 Thread Daniel Verite
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

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

2009-11-09 Thread Adrian Klaver
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

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

2009-11-09 Thread John R Pierce
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

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

2009-11-09 Thread Tim Uckun
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

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

2009-11-09 Thread Tim Uckun
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

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

2009-11-09 Thread Daniel Verite
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,

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

2009-11-09 Thread Adrian Klaver
- 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

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

2009-11-09 Thread Tim Uckun
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                              

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

2009-11-09 Thread Tom Lane
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

[GENERAL] I can't seem to put the right combination of magic into the pg_hba and pg_ident files.

2009-11-08 Thread Tim Uckun
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

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

2009-11-08 Thread Tom Lane
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

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

2009-11-08 Thread Tim Uckun
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

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

2009-11-08 Thread Scott Marlowe
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.

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

2009-11-08 Thread Tim Uckun
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

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

2009-11-08 Thread John R Pierce
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