Re: [INTERFACES] libpq & user

From: Robert Knop <rknop(at)panisse(dot)lbl(dot)gov>
To: Herouth Maoz <herouth(at)oumail(dot)openu(dot)ac(dot)il>
Cc: pgsql-interfaces(at)postgreSQL(dot)org
Subject: Re: [INTERFACES] libpq & user
Date: 1998-07-15 15:04:39
Message-ID: Pine.SOL.3.95.980715080309.8510A-100000@panisse.lbl.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

> In the psql source code, they set the user by setting the PGUSER
> environment variable. The source of the PQsetdb function states that the
> following environment variables are accepted (although this is not
> documented - at least not in my old 6.2.1 version):

Aha! Thank you, that was the secret. I do not believe that these
environment variables are documented in 6.3.1 either -- at least, I didn't
find them. I tried USER, but not PGUSER. Setting PGUSER worked.

> Another option: the psql source, when needing a password, uses the
> undocumented function:
>
> PQconnectdb( connection_string );
>
> The connection string is a C character string containing pairs of names and
> values. For example: "host=dara user=deep password=ocean dbname=deep".

This is how the Pg.pm perl connectdb function works; that _is_ documented
in the Pg man page. Presumably this is a "documented" feature of libpq,
but the documentation hasn't caught up yet. (Of course, it's always scary
to assume things like that.)

Thanks again for your help.

-Rob

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
==== Rob Knop ===== rknop(at)lbl(dot)gov ====== http://panisse.lbl.gov/~rknop ======

In response to

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message Jeffrey Napolitano 1998-07-15 16:25:00 Old JDBC drivers
Previous Message Bruce Momjian 1998-07-15 14:42:00 Re: [INTERFACES][HACKERS] atttypmod now 32 bits, interface change