>>>>> "David" == David E Wheeler <david@justatheory.com> writes:
David> And it works great, including in PL/pgSQL functions, except inDavid> an exception block. When I run this:
David> BEGIN;
David> CREATE OR REPLACE FUNCTION foo(David> ) RETURNS BOOLEAN IMMUTABLE LANGUAGE PLPGSQL AS $$David>
DECLAREDavid> things TEXT[] := '{}';David> BEGINDavid> things := things || 'foo';David>
RAISEdivision_by_zero;
This "raise" statement is not reached, because the previous line raises
the "malformed array literal" error.
David> EXCEPTION WHEN OTHERS THEN
If you change this to EXCEPTION WHEN division_by_zero THEN, the
reported error becomes:
ERROR: malformed array literal: "foo"
LINE 1: SELECT things || 'foo'
--
Andrew (irc:RhodiumToad)