libpq & user
От | Robert Knop |
---|---|
Тема | libpq & user |
Дата | |
Msg-id | Pine.SOL.3.95.980714135850.7053F-100000@panisse.lbl.gov обсуждение исходный текст |
Ответы |
Re: [INTERFACES] libpq & user
|
Список | pgsql-interfaces |
Hi -- I'm trying to use libpq to read a Postgres database from C. I use the following command to connect to the database: PGconn *deep; deep=PQsetdb("dara",NULL,"user=deep",NULL,"deep"); ("dara" is the host where postmaster is running; "deep" is the name of the database, and the user I'm trying to connect as.) The problem is, lots of different people will be using this, and I'm trying to avoid having to put all of the various usernames in the Postgres shadow file by having everybody connect as user deep. I have not found anywhere in the documentation how to set the user with libpq; what I've tried here is based on analogy to the Pg Perl module (which I have been able to get working). Can somebody give me any suggestions? (I've already tried setting the USER variable with putenv(), to no avail.) Thank you, -Rob =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= ==== Rob Knop ===== rknop@lbl.gov ====== http://panisse.lbl.gov/~rknop ======
В списке pgsql-interfaces по дате отправления: