Error reporting

From: Soma Interesting <dfunct(at)telus(dot)net>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Error reporting
Date: 2001-01-13 00:16:12
Message-ID: 5.0.2.1.0.20010112160251.02810ff8@pop.telus.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


I'm working with PHP and Postgres.

I want to start making more use of the database's ability to maintain the
integrity of data. For example, when adding a value to a table where I
don't want duplicates. Instead of pre searching with PHP for the submitted
value in the table, then if the value isn't already existing in the table,
submit the new value - I was just going to add the new value, then check
the contents of pg_errormessage() to determine the success or failure of
the command.

Pg_errormessage returns a nice long string about there not being allowed
duplicate values. This isn't the easiest return for handling error
checking, ideally I can configure Postgres to return only numeric error
codes so that pg_errormessage would return those numerical values that I
can easily test on.

Is this possible? Is this how everyone does it? Am I missing something -
Like a page from the manual? :)

Thanks once again.

Browse pgsql-general by date

  From Date Subject
Next Message Kevin T. Manley (home) 2001-01-13 02:51:06 permissions on user-defined functions
Previous Message Ed Loehr 2001-01-13 00:13:27 Re: [GENERAL] Re: ODBC connect in ERWin