Re: grouping treated as keyword in function return table

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Mike Porter <mike(at)udel(dot)edu>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: grouping treated as keyword in function return table
Date: 2016-07-12 16:06:12
Message-ID: 24492.1468339572@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Mike Porter <mike(at)udel(dot)edu> writes:
> Postgres 9.5.3 built from source. However, I think this has been
> happening for a long time.

Only since 9.5, because GROUPING wasn't a keyword before that.

> 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.

This is expected given that it's now partially reserved.

> Additionally, pg_dumpall does not quote grouping when dumping
> the function so the function will not be restored when the dump is
> loaded.

That would be a pg_dump bug, but it doesn't happen for me: I get

CREATE FUNCTION a() RETURNS TABLE("grouping" integer)
LANGUAGE sql
AS $$ select 1; $$;

Sure you're using 9.5 pg_dump?

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Mike Porter 2016-07-12 16:44:50 Re: grouping treated as keyword in function return table
Previous Message Mike Porter 2016-07-12 15:51:05 grouping treated as keyword in function return table