From: | Krishnaprasad <k(dot)krishna(at)hcl(dot)in> |
---|---|
To: | Michael Fuhr <mike(at)fuhr(dot)org> |
Cc: | PostgreSQL Novice <pgsql-novice(at)postgresql(dot)org> |
Subject: | Re: Regarding PL/SQL with C |
Date: | 2006-02-27 03:54:33 |
Message-ID: | 440277F9.8010402@hcl.in |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-novice |
hi michael
thanks for ur input... I tried with *PQconnectdb* also. But
still it is showing connection error
when I tried with PQErrorMessage it is coming as below.
*FATAL: IDENT authentication failed for user "postgres" ...
pls help..
thanks
krishna
*
Michael Fuhr wrote:
>On Sat, Feb 25, 2006 at 02:03:51PM +0530, Krishnaprasad wrote:
>
>
>>I have written code for connecting to a database and select one row and
>>just print it out.. Iam able to make a connection with the databse. But
>>after connection it is showing that select query failed.... but if iam
>>directly selecting through PL/SQL prompt iam able to do the same.......
>>
>>
>
>You're connecting to the database thusly:
>
>
>
>> conn = PQconnectStart("user=postgres,dbname=krishna");
>>
>>
>
>Parameters in the connect string should be space-separated, not
>comma-separated. The select is probably failing because the connect
>failed; you're not seeing the connection failure because you're
>calling PQconnectStart to make a nonblocking connection and you're
>not waiting for the connection to complete before making the query.
>Unless you need a nonblocking connection use PQconnectdb instead:
>
> conn = PQconnectdb("user=postgres dbname=krishna");
>
>Then check for CONNECTION_OK, not CONNECTION_MADE.
>
>When an operation has failed, you can use PQerrorMessage or
>PQresultErrorMessage to display the reason.
>
>
>
--
Rgds
KRISHNAPRASAD.K
R&D Engineer
HCL INFOSYSTEMS LTD
PONDICHERRY
Mob:09894530948
From | Date | Subject | |
---|---|---|---|
Next Message | Michael Fuhr | 2006-02-27 05:20:13 | Re: Regarding PL/SQL with C |
Previous Message | Tom Lane | 2006-02-26 19:06:00 | Re: references versus foreign keys |