Re: "A block containing an EXCEPTION clause is significantly more expensive to enter and exit than a block without one" - Mailing list pgsql-general

From Tom Lane
Subject Re: "A block containing an EXCEPTION clause is significantly more expensive to enter and exit than a block without one"
Date
Msg-id 3910372.1655149134@sss.pgh.pa.us
Whole thread Raw
In response to Re: "A block containing an EXCEPTION clause is significantly more expensive to enter and exit than a block without one"  (Bryn Llewellyn <bryn@yugabyte.com>)
List pgsql-general
Bryn Llewellyn <bryn@yugabyte.com> writes:
> OK, so I'm obliged to answer.
> Because SQL rests on the principle that you just say *what* you want but
> not *how*.

It also rests on the principle that the programmer shouldn't be too
concerned about micro-efficiencies.  You've given a perfectly good
six-line implementation of what you want; use it and be happy.

> Oracle Database 12c Release 2 (and later) has a validate_conversion() built-in.

[ shrug... ]  We are not Oracle.  One of the main ways in which we
are not Oracle is that we support extensible database functionality.
To write a "validate_conversion" function that supports extension
datatypes, but doesn't use something morally equivalent to a
subtransaction, would be a nightmare: large, fragile, and probably
not all that much faster.

            regards, tom lane



pgsql-general by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: "A block containing an EXCEPTION clause is significantly more expensive to enter and exit than a block without one"
Next
From: Christophe Pettus
Date:
Subject: Re: "A block containing an EXCEPTION clause is significantly more expensive to enter and exit than a block without one"