Re: Error message with plpgsql CONTINUE

From: Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Error message with plpgsql CONTINUE
Date: 2015-08-17 19:46:37
Message-ID: 55D23A1D.2080506@BlueTreble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2015-08-17 20:26:01 Re: jsonb array-style subscripting
Previous Message Andres Freund 2015-08-17 19:46:12 Re: replication slot restart_lsn initialization