Re: error codes in postgresql

From: Sivakumar K <sivakumark(at)aztec(dot)soft(dot)net>
To: sandhya <sandhyar(at)amiindia(dot)co(dot)in>
Cc: Shashi Gireddy <gireddy(at)gmail(dot)com>, postgre <pgsql-admin(at)postgresql(dot)org>
Subject: Re: error codes in postgresql
Date: 2005-08-17 12:19:30
Message-ID: 584DE893B0E08F4B9748E295029F1E9702C1114A@maya.aztec.soft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi sandhya,

You can use PQresultStatus API to get the result status of the command
execution

And PQresStatus to convert the enumerated type returned by
PQresultStatus to a string constant.

For more information you can check the libpq API documentation

http://www.postgresql.org/docs/8.0/static/libpq-exec.html
<http://www.postgresql.org/docs/8.0/static/libpq-exec.html>

Is this what you want?

Regards,

Siva Kumar.K

-----Original Message-----
From: pgsql-admin-owner(at)postgresql(dot)org
[mailto:pgsql-admin-owner(at)postgresql(dot)org] On Behalf Of sandhya
Sent: Wednesday, August 17, 2005 3:49 PM
To: Tom Lane
Cc: Shashi Gireddy; postgre
Subject: [ADMIN] error codes in postgresql

Hi,

I want to know ,if there is any way to return error codes/numbers as a
return value from the postgresql functions.

For ex:

If i am using my connection function say,

DbConnect(dname,uname,.........)

{

//here i use postgres connection function

pg_conn *conn;

conninfo="dbname=example(dname) user=postgres(uname)";

conn=PQConnectdb(conninfo)

//After connecting i need to create a table..and if the table exists

PQerrormessage(conn) will return error message...

But what i need is ..

Is there any other way of returning error number to my main program.

Can you please tell me how to handle these errors in my application.

I referred posgresql site..I didn't get any clear idea of it.

Any help please......

Thank you...

Regards,

Sandhya R

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message josh@segrestfarms.com 2005-08-17 12:39:22 Re: SQL Help - Obtaining ID of record INSERTED
Previous Message sandhya 2005-08-17 10:19:02 error codes in postgresql