grouping treated as keyword in function return table

Поиск
Список
Период
Сортировка
От Mike Porter
Тема grouping treated as keyword in function return table
Дата
Msg-id alpine.OSX.2.20.1607121145281.45959@qbp.aff.hqry.rqh
обсуждение исходный текст
Ответы Re: grouping treated as keyword in function return table  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
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

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Amit Kapila
Дата:
Сообщение: Re: BUG #14243: pg_basebackup failes by a STATUS_DELETE_PENDING file
Следующее
От: Tom Lane
Дата:
Сообщение: Re: grouping treated as keyword in function return table