PG and error handling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have been looking for a resource on how to do proper error handling with
PostgreSQL connections and queries. In one specific case, I have a
referential integrity constraint on a table. When I try to delete from that
table, it fails, as it should, when there is something referring to the
entry I am trying to erase. All fine and dandy.

Problem is, I don't think pg_last_error() is a proper way to notify the user
that they need to revise how they are proceeding with their action. In other
words, I want to first DETECT that the integrity constraint has been
violated (I am most likely to know why it has happened), and then print to
the user a message the user will understand. (If the user were indeed a
programmer, I supposed pg_last_error() would be fine indeed)

So, is there any resource I can look at that is not only a tutorial but also
provides a complete reference as to how to handle such errors? Everywhere I
have looked there is only simple stuff like "How to connect to your PG
Database" or "How to get data from your database". It would be much
appreciated if there was some resource to be share that fully explains how
to do error handling on the web somewhere!

Your time is much appreciated,
Jonathan

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux