sam wrote:

FUNCTION UPDATE ()
BEGIN
 UPDATE statement

 EXCEPTION
END


when one record fails data only for that is rolled back the rest of
the data is saved. EXCEPTION has to be caught.

As I recently found out, too many savepoints really kill PostgreSQL's performance in a transaction. A function inserting/updating, say, 100,000 records will perform OK, but statements run in the same transaction after the function completes will be very slow.

So ... if you find that after your big update statement performance is terrible, you might need to explicitly check the conditions that might result in an exception and skip those records, thus avoiding the EXCEPTION block.

--
Craig Ringer

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to