"David G. Johnston" <david.g.johnston@xxxxxxxxx> writes: > Not sure how much detail you are looking for but the docs say this: > "Tip: A block containing an EXCEPTION clause is significantly more > expensive to enter and exit than a block without one. Therefore, don't use > EXCEPTION without need." > https://www.postgresql.org/docs/current/static/plpgsql-control-structures.html#PLPGSQL-ERROR-TRAPPING > I'm somewhat doubting "plan caching" has anything to do with this; I > suspect its basically that there is high memory and runtime overhead to > deal with the possibilities of needing to convert a exception into a branch > instead of allowing it to be fatal. Yeah, it's about the overhead of setting up and ending a subtransaction. That's a fairly expensive mechanism, but we don't have anything cheaper that is able to recover from arbitrary errors. regards, tom lane -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general