Postgres 9.5.3 built from source. However, I think this has been
happening for a long time.
create function a() returns table( grouping integer ) language sql as $$
select 1;
$$;
ERROR: syntax error at or near "grouping"
LINE 1: create function a() returns table( grouping integer ) langua...
If we quote "grouping"
^
create function a() returns table( "grouping" integer ) language sql as $$
select 1;
$$
;
CREATE FUNCTION
grouping is a valid column in a table and does not need to be quoted:
create temp table test( grouping integer );
CREATE TABLE
So, in almost all cases grouping is not required to be quoted,
however when used in a table defined as a function return type, it
is. Additionally, pg_dumpall does not quote grouping when dumping
the function so the function will not be restored when the dump is
loaded.
Thanks,
Mike
-
Mike Porter
PGP Fingerprint: F4 AE E1 9F 67 F7 DA EA 2F D2 37 F3 99 ED D1 C2