Oops, as it happens I had an error in my program logic and pg_conn was
actually true.
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
Daniel wrote:
> I have written a C/C++ program that trys to log into a local
> PostgreSQL database. Here is the code:
>
> pg_conn = PQconnectdb(
> "hostaddr = '127.0.0.1' port = '' dbname = 'TBDB' user = 'sysdba'
> password = 'stelmo777' connect_timeout = '10'");
> if (!pg_conn)
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Did you check you pg_hba.conf ?
another thing: although port defaults to 5432 you *should* specify
that in the connection string.
also... is "sysdba" *really* an authorized user? check your permissions...
BR,
Pedro.
On 12/02/2009 09:42 PM, Tom Lane w
Daniel writes:
> I have written a C/C++ program that trys to log into a local
> PostgreSQL database. Here is the code:
> pg_conn = PQconnectdb(
> "hostaddr = '127.0.0.1' port = '' dbname = 'TBDB' user = 'sysdba'
> password = 'stelmo777' connect_timeout = '10'");
> if (!pg_conn)
> {
>
I have written a C/C++ program that trys to log into a local
PostgreSQL database. Here is the code:
pg_conn = PQconnectdb(
"hostaddr = '127.0.0.1' port = '' dbname = 'TBDB' user = 'sysdba'
password = 'stelmo777' connect_timeout = '10'");
if (!pg_conn)
{
return false;
}
if (P