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:58:20
Message-ID: 26785.1468342700@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:
> On Tue, 12 Jul 2016, Tom Lane wrote:
>> Only since 9.5, because GROUPING wasn't a keyword before that.

> I noticed that grouping is fully quoted in all the tables in the
> dump. Will grouping be a fully reserved word at some point?

Well, we won't voluntarily make it so, but the SQL committee seems not to
care when inventing new syntax whether it requires fully reserving new
keywords to make it work. So it's a matter of what they do and whether
we decide we want to adopt the feature/syntax.

As far as dumps go, our default practice is to quote any non-unreserved
keyword; it's not worth the trouble to decide for partially-reserved
words whether they'd really need to be quoted in the specific context.

>> Sure you're using 9.5 pg_dump?

> My notes say so.
> /usr/local/postgresql-9.5.3/bin/pg_dumpall -h a.server -U postgres > 9.5.3.sql

Hm, is the source server 9.5? I think that the TABLE clause is actually
generated server-side in this case.

When you're making a dump you intend to load into a different server
version, we recommend using --quote-all-identifiers to make sure you're
not blindsided by identifiers that have become reserved words in the
newer server version.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

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