Re: Cannot login, with C/C++ program - Mailing list pgsql-general

From Daniel Verite
Subject Re: Cannot login, with C/C++ program
Date
Msg-id b8bb920d-d023-4577-80d0-e575031b4608@mm
Whole thread Raw
In response to Cannot login, with C/C++ program  (Daniel <danwgrace@gmail.com>)
List 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)
>   {
>     return false;
>   }

In the program, you should
 fprintf(stderr, "%s", PQerrorMessage(pg_conn))
and/or
 copy-paste for us the psql command line that works.

Best regards,
--
Daniel
PostgreSQL-powered mail user agent and storage: http://www.manitou-mail.org

pgsql-general by date:

Previous
From: Brian Witt
Date:
Subject: Re: use log_statement to log only SELECTs?
Next
From: Adrian Klaver
Date:
Subject: Re: Catastrophic changes to PostgreSQL 8.4