Re: Fwd: postgresql-autodoc - missinterprets "version" - Mailing list pgsql-bugs

From Stephan Szabo
Subject Re: Fwd: postgresql-autodoc - missinterprets "version"
Date
Msg-id 20040708065640.Q90613@megazone.bigpanda.com
Whole thread Raw
In response to Fwd: postgresql-autodoc - missinterprets "version"  (Martin Pitt <martin@piware.de>)
Responses Re: Fwd: postgresql-autodoc - missinterprets "version"  (Martin Pitt <martin@piware.de>)
List pgsql-bugs
On Thu, 8 Jul 2004, Martin Pitt wrote:

> Hi PostgreSQL developers!
>
> Recently we got the bug report below. It seems that there is a special
> treatment of columns named "version". Normally fields of primary key
> indices are printed out unquoted, however, if the column is named
> "version", the name is printed out in quotes.
>
> This behaviour seems to confuse PostgreSQL autotoc.
>
> Does this behaviour serve any purpose or it is an error?

It doesn't appear to be necessary to quote the identifier, however version
and "version" refer to the same identifier in this case so I wouldn't call
it an error, either.  My guess as to the reason comes from this comment
fragment in quote_identifier:

* Check for keyword.  This test is overly strong, since many of
* the "keywords" known to the parser are usable as column names,
* but the parser doesn't provide any easy way to test for whether
* an identifier is safe or not... so be safe not sorry.

version is one of those keywords that are usable as column names I
believe.

pgsql-bugs by date:

Previous
From: Martin Pitt
Date:
Subject: Fwd: postgresql-autodoc - missinterprets "version"
Next
From: Martin Pitt
Date:
Subject: Re: Fwd: postgresql-autodoc - missinterprets "version"