libpq & user - Mailing list pgsql-interfaces

From Robert Knop
Subject libpq & user
Date
Msg-id Pine.SOL.3.95.980714135850.7053F-100000@panisse.lbl.gov
Whole thread Raw
Responses Re: [INTERFACES] libpq & user  (Herouth Maoz <herouth@oumail.openu.ac.il>)
List 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 by date:

Previous
From: The Hermit Hacker
Date:
Subject: RE: [INTERFACES] What technology ???
Next
From: "õ¼º¸¸"
Date:
Subject: [ODBC support]