pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: sandhya <sandhyar@amiindia.co.in>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Shashi Gireddy <gireddy@gmail.com>
Cc: postgre <pgsql-admin@postgresql.org>
Subject: error codes in postgresql
Date: Wed, 17 Aug 2005 15:49:02 +0530
Message-ID: <007301c5a315$1cf97b80$cd00000a@amiindiahjwbgh> (raw)



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

view thread (5+ messages)  latest in thread

Message-ID: <007301c5a315$1cf97b80$cd00000a@amiindiahjwbgh>
Permalink:  ../007301c5a315$1cf97b80$cd00000a@amiindiahjwbgh/
Also on:    postgresql.org/message-id/007301c5a315$1cf97b80$cd00000a@amiindiahjwbgh

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: sandhyar@amiindia.co.in, tgl@sss.pgh.pa.us, gireddy@gmail.com
  Subject: Re: error codes in postgresql
  In-Reply-To: <007301c5a315$1cf97b80$cd00000a@amiindiahjwbgh>
  References: <007301c5a315$1cf97b80$cd00000a@amiindiahjwbgh>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox