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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bryn Llewellyn <bryn(at)yugabyte(dot)com>
Cc: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, pgsql-general list <pgsql-general(at)lists(dot)postgresql(dot)org>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Subject: Re: "A block containing an EXCEPTION clause is significantly more expensive to enter and exit than a block without one"
Date: 2022-06-13 19:38:54
Message-ID: 3910372.1655149134@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Bryn Llewellyn <bryn(at)yugabyte(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Christophe Pettus 2022-06-13 20:07:45 Re: "A block containing an EXCEPTION clause is significantly more expensive to enter and exit than a block without one"
Previous Message Pavel Stehule 2022-06-13 19:38:35 Re: "A block containing an EXCEPTION clause is significantly more expensive to enter and exit than a block without one"