Cannot login, with C/C++ program

From: Daniel <danwgrace(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Cannot login, with C/C++ program
Date: 2009-12-02 16:46:53
Message-ID: fc0f8511-ee51-4e6c-896e-a6d51bfd1cbf@r24g2000yqd.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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 (PQstatus(pg_conn) != CONNECTION_OK)
{
return false; // <- execution reaches here.

I checked the database, user and password by logging in with psql.
What could be wrong?

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2009-12-02 16:47:00 Re: Roles with passwords; SET ROLE ... WITH PASSWORD ?
Previous Message Tom Lane 2009-12-02 16:42:13 Re: Undefined subroutine &main::spi_prepare