CREATE TABLE AS WITH NO DATA
Another small piece of parser acrobatics to become standard conforming.
Attachments:
ctas-with-no-data.difftext/plain; name=ctas-with-no-data.diff; x-mac-creator=0; x-mac-type=0Download+54-27
Peter Eisentraut <peter_e@gmx.net> writes:
Another small piece of parser acrobatics to become standard conforming.
I think we deliberately decided that we weren't going to implement this
syntax because it required this sort of pushup to provide a uselessly
redundant behavior. Adding more special cases to base_yylex is not
free, either in maintenance or in surprises for users. An example is
that trying to use LOCAL or NO as the name of a CTE will fail if this
patch is applied.
I'd like us to be trying to get rid of the special cases in base_yylex
not add more. (It strikes me that now that WITH is fully reserved,
we might not need some of the ones that are there anymore.)
regards, tom lane
I wrote:
I'd like us to be trying to get rid of the special cases in base_yylex
not add more. (It strikes me that now that WITH is fully reserved,
we might not need some of the ones that are there anymore.)
In fact, it looks like what we should do is heed the existing comment
in parser.c: remove the existing WITH_foo combined tokens and invent
WITH_TIME instead. Then, no additional combined tokens are needed to
handle WITH [NO] DATA. So I propose the attached form of the patch
instead (docs omitted).
regards, tom lane