From: | Jonathan Zacharuk <jonathan(dot)zacharuk(at)ascentech(dot)ca> |
---|---|
To: | "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org> |
Subject: | Error when using unquoted identifier that contains the word end in a begin atomic block |
Date: | 2023-08-24 19:53:03 |
Message-ID: | YT2PR01MB4318B3BD0B4D84546C3EAC169C1DA@YT2PR01MB4318.CANPRD01.PROD.OUTLOOK.COM |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
PostgreSQL 15.2 (Debian 15.2-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
Run via Docker 15.4 image
It seems to me that within a BEGIN ATOMIC block the use of the word "end" within an unquoted identifier is causing an error.
The word "end" is a reserved keyword. However, it is my understanding from the documentation that keywords cannot be used *as* an identifier, but they should be able to be used within an identifier.
For instance, the "end" in effective_end_date is a valid identifier.
-- Create a data set with the word end in it.
CREATE VIEW test_view AS
SELECT CURRENT_TIMESTAMP as effective_end_date
> OK
> Query Time: 0.002s
-- This function is successfully created (note the quoted "effective_end_date").
CREATE OR REPLACE FUNCTION test_function_success() RETURNS TIMESTAMP
LANGUAGE SQL
BEGIN ATOMIC
SELECT DISTINCT "effective_end_date"
FROM test_view;
END
> Affected rows: 0
> Query Time: 0.001s
-- This function fails to be created. I would expect this to work.
CREATE OR REPLACE FUNCTION test_function_fail() RETURNS TIMESTAMP
LANGUAGE SQL
BEGIN ATOMIC
SELECT DISTINCT effective_end_date
FROM test_view
> ERROR: syntax error at end of input
LINE 6: FROM test_view
^
> Query Time: 0s
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2023-08-24 20:12:26 | Re: Error when using unquoted identifier that contains the word end in a begin atomic block |
Previous Message | David G. Johnston | 2023-08-24 12:49:47 | Re: BUG #18068: Insufficient permission unless SUPERUSER |