From: | Robert Knop <rknop(at)panisse(dot)lbl(dot)gov> |
---|---|
To: | pgsql-interfaces(at)postgresql(dot)org |
Subject: | libpq & user |
Date: | 1998-07-14 21:02:10 |
Message-ID: | Pine.SOL.3.95.980714135850.7053F-100000@panisse.lbl.gov |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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(at)lbl(dot)gov ====== http://panisse.lbl.gov/~rknop ======
From | Date | Subject | |
---|---|---|---|
Next Message | chunman | 1998-07-15 00:47:28 | [ODBC support] |
Previous Message | The Hermit Hacker | 1998-07-14 18:31:07 | RE: [INTERFACES] What technology ??? |