We still claim "cannot begin/end transactions in PL/pgSQL" - Mailing list pgsql-hackers

From Tom Lane
Subject We still claim "cannot begin/end transactions in PL/pgSQL"
Date
Msg-id 15479.1527265001@sss.pgh.pa.us
Whole thread Raw
Responses Re: We still claim "cannot begin/end transactions in PL/pgSQL"  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
List pgsql-hackers
I notice there are still several places in pl_exec.c like this:

        case SPI_ERROR_TRANSACTION:
            ereport(ERROR,
                    (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
                     errmsg("cannot begin/end transactions in PL/pgSQL"),
                     errhint("Use a BEGIN block with an EXCEPTION clause instead.")));
            break;

At best, the wording of these error messages is now obsolete.  I'm not
sure if we expect them to be reachable at all.  If they should be
can't-happen cases, I'd suggest just deleting them and letting control
fall to the generic default: cases in each switch.  If they are reachable,
the messages need work.

            regards, tom lane


pgsql-hackers by date:

Previous
From: Greg Clough
Date:
Subject: RE: Enhancement Idea - Expose the active value of a parameter inpg_settings
Next
From: Robert Haas
Date:
Subject: Re: Enhancement Idea - Expose the active value of a parameter in pg_settings