Обсуждение: libpgtcl and passwords
Is there a way to user username/passwords with libpgtcl? I don't see any options in pg_connect. Is it pg_connect -conninfo conninfoString? Does conninfoString match libpq's PQconnectdb? -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 853-3000+ If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill, Pennsylvania19026
>
> Is there a way to user username/passwords with libpgtcl? I don't see
> any options in pg_connect. Is it pg_connect -conninfo conninfoString?
> Does conninfoString match libpq's PQconnectdb?
I think I found the answer:
/* * Establish a connection using the new PQconnectdb() interface */ if (argc != 3) {
Tcl_AppendResult(interp, "pg_connect: syntax error\n", 0); Tcl_AppendResult(interp, "pg_connect
-conninfoconninfoString", 0); return TCL_ERROR; }
It wasn't clear to me that -conninfo is the standard PQconnectdb string
from the manual. Let me see if I can clear that up.
-- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610)
853-3000+ If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill,
Pennsylvania19026
On Fri, Apr 27, 2001 at 11:02:53PM -0400, Bruce Momjian wrote: > > Is there a way to user username/passwords with libpgtcl? I don't see > any options in pg_connect. Is it pg_connect -conninfo conninfoString? > Does conninfoString match libpq's PQconnectdb? set p [pg_connect -conninfo "user=postgres host=localhost dbname=erm \ password=xxx"] is this what you are asking for? ciao sandro *:-) -- Sandro Dentella *:-) e-mail: sandro@ermit.it sandro.dentella@mi.infn.it
> On Fri, Apr 27, 2001 at 11:02:53PM -0400, Bruce Momjian wrote: > > > > Is there a way to user username/passwords with libpgtcl? I don't see > > any options in pg_connect. Is it pg_connect -conninfo conninfoString? > > Does conninfoString match libpq's PQconnectdb? > > set p [pg_connect -conninfo "user=postgres host=localhost dbname=erm \ > password=xxx"] > > is this what you are asking for? Yes, I later found -conninfo, and updated the SGML to mention that the flags supported are those of libpq's PQconnectdb. Thanks. -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 853-3000+ If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill, Pennsylvania19026