pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
C API - Authentication Question
3+ messages / 3 participants
[nested] [flat]

* C API - Authentication Question
@ 1998-08-15 02:43  secret <secret@kearneydev.com>
  0 siblings, 1 reply; 3+ messages in thread

From: secret @ 1998-08-15 02:43 UTC (permalink / raw)
  To: pgsql-interfaces

    I'm very impressed so far with what I've seen of PostgreSQL,
however I have a nagging question which is absolutely vital for the
project I have in mind... How do I tell PostgreSQL what
username:password to use to authenticate myself to the database?

    I'm going to have clients(Linux) on changing IPs that must be
authenicated with user:pw, not simply by host, I understand how to
change the config file to allow connections but I can't find sufficient
documentation to tell me how to give a username:pw pair...

    Thank you in advance...

--David





^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: [INTERFACES] C API - Authentication Question
@ 1998-08-15 15:00  Tom Lane <tgl@sss.pgh.pa.us>
  parent: secret <secret@kearneydev.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Tom Lane @ 1998-08-15 15:00 UTC (permalink / raw)
  To: secret <secret@kearneydev.com>; +Cc: pgsql-interfaces

secret <secret@kearneydev.com> writes:
> ... How do I tell PostgreSQL what
> username:password to use to authenticate myself to the database?

PQsetdbLogin() or PQconnectdb().  Alternatively you can pass them in
as values of environment variables PGUSER and PGPASSWORD.  I don't
much like keeping a password in an environment variable on security
grounds, but this would work if you want to use some client program
that offers no convenient way to enter id/password.

It looks like the documentation is seriously lacking in this area:
the current libpq man page doesn't describe PQconnectdb() at all,
and the possibility to pass in a password via PGPASSWORD isn't mentioned
there either.  You'll get along with PostgreSQL a lot better if you
don't mind looking at code when you can't find something in the docs :-(

BTW you should also consider Kerberos authentication --- much more
secure than passing cleartext or trivially-encrypted passwords around
the net.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: [INTERFACES] C API - Authentication Question
@ 1998-08-15 16:50  Thomas G. Lockhart <lockhart@alumni.caltech.edu>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 3+ messages in thread

From: Thomas G. Lockhart @ 1998-08-15 16:50 UTC (permalink / raw)
  To: pgsql-interfaces; +Cc: secret <secret@kearneydev.com>

> You'll get along with PostgreSQL a lot better if you
> don't mind looking at code when you can't find something in the docs 
> :-(

Or, even better, by updating the docs when you discover something is
missing! That'll help the next person... (hint, hint *grin*)

                      - Tom



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~1998-08-15 16:50 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1998-08-15 02:43 C API - Authentication Question secret <secret@kearneydev.com>
1998-08-15 15:00 ` Tom Lane <tgl@sss.pgh.pa.us>
1998-08-15 16:50   ` Thomas G. Lockhart <lockhart@alumni.caltech.edu>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox