Also, adrian.klaver@xxxxxxxxxxx wrote:
Thank you both. I never would have guessed that a word with "reserved" status could be used as a column alias (with or without preceding it with AS). "not completely reserved in PostgreSQL" makes this sound like a PG special. So I was caught out yet again. And I fear that I'll continue to be caught out with other things—and maybe this one too, at some later date, when I've forgotten the present exchanges… Anyway, I believe that I have the answer to my question. And my new mental model allowed me to predict that, as presented, this would work: create function f() returns text language plpgsql as $body$ declare a constant int := 3; b constant int := 5; c constant int := 7; begin return a + b case /* + c */; end; $body$; select f(); It does! It predicted, too, that when "+ c" is uncommented, "create function" would fail with a syntax error. And that prediction also held out. |