Re: Sanding down some edge cases for PL/pgSQL reserved words - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Sanding down some edge cases for PL/pgSQL reserved words
Date
Msg-id 330657.1749419360@sss.pgh.pa.us
Whole thread Raw
In response to Re: Sanding down some edge cases for PL/pgSQL reserved words  (Pavel Stehule <pavel.stehule@gmail.com>)
Responses Re: Sanding down some edge cases for PL/pgSQL reserved words
List pgsql-hackers
Pavel Stehule <pavel.stehule@gmail.com> writes:
> Is there some description of what keywords should be reserved? If I
> remember correctly, the scanner was changed more times, and maybe more
> reserved keywords are not necessary.

Per the comment in pl_scanner.c:

 * We try to avoid reserving more keywords than we have to; but there's
 * little point in not reserving a word if it's reserved in the core grammar.
 * Currently, the following words are reserved here but not in the core:
 * BEGIN BY DECLARE EXECUTE FOREACH IF LOOP STRICT WHILE

This patch gets rid of EXECUTE and STRICT, but the others are harder
to de-reserve.  I think most of the rest are there because they can
follow a block or loop label, and the same comment observes

 * (We still have to reserve initial keywords that might follow a block
 * label, unfortunately, since the method used to determine if we are at
 * start of statement doesn't recognize such cases.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: pg_restore - cannot to restore blobs in dictionary format from older pg dumps
Next
From: Tomas Vondra
Date:
Subject: Re: Amcheck verification of GiST and GIN