Re: [HACKERS] Malformed Array Literal in PL/pgSQL Exception Block
От | Andrew Gierth |
---|---|
Тема | Re: [HACKERS] Malformed Array Literal in PL/pgSQL Exception Block |
Дата | |
Msg-id | 87lgr8x3vp.fsf@news-spur.riddles.org.uk обсуждение исходный текст |
Ответ на | [HACKERS] Malformed Array Literal in PL/pgSQL Exception Block ("David E. Wheeler" <david@justatheory.com>) |
Ответы |
Re: [HACKERS] Malformed Array Literal in PL/pgSQL Exception Block
|
Список | pgsql-hackers |
>>>>> "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)
В списке pgsql-hackers по дате отправления: