Skip site navigation (1) Skip section navigation (2)

Re: [INTERFACES] C API - Authentication Question

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: secret <secret(at)kearneydev(dot)com>
Cc: pgsql-interfaces(at)postgreSQL(dot)org
Subject: Re: [INTERFACES] C API - Authentication Question
Date: 1998-08-15 15:00:24
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-interfaces
secret <secret(at)kearneydev(dot)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


pgsql-interfaces by date

Next:From: Thomas G. LockhartDate: 1998-08-15 16:50:11
Subject: Re: [INTERFACES] C API - Authentication Question
Previous:From: Goran ThyniDate: 1998-08-15 13:14:50
Subject: PgSQL released

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group