Re: Error message with plpgsql CONTINUE - Mailing list pgsql-hackers

From Jim Nasby
Subject Re: Error message with plpgsql CONTINUE
Date
Msg-id 55D23A1D.2080506@BlueTreble.com
Whole thread Raw
In response to Re: Error message with plpgsql CONTINUE  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Error message with plpgsql CONTINUE  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 8/17/15 9:48 AM, Tom Lane wrote:
> I'm inclined to think that if we wanted to make this better, the way to
> improve it would be to detect the error*at compile time*, and get rid of
> this hack in plpgsql_exec_function altogether.  pl_gram.y already
> successfully detects cases where CONTINUE mentions a label that doesn't
> exist or isn't surrounding the CONTINUE.  What it is missing is that we
> don't distinguish labels on loops from labels on non-loop statements, and
> thus it can't tell if CONTINUE is referencing a non-loop label or has no
> label but is not inside any loop-type statement.  Seems like that detail
> could be added to the PLpgSQL_nsitem data structure without a huge amount
> of work.

So split PLPGSQL_NSTYPE_LABEL into PLPGSQL_NSTYPE_BLOCK_LABEL and 
PLPGSQL_NSTYPE_LOOP_LABEL, and split opt_block_label and opt_label the 
same way?
-- 
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Data in Trouble? Get it in Treble! http://BlueTreble.com



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: replication slot restart_lsn initialization
Next
From: Peter Geoghegan
Date:
Subject: Re: jsonb array-style subscripting