Re: Exposing keywords to clients - Mailing list pgsql-patches

From Dave Page
Subject Re: Exposing keywords to clients
Date
Msg-id 937d27e10805031244h5f08a772l77e0f35b019b4f31@mail.gmail.com
Whole thread Raw
In response to Re: Exposing keywords to clients  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Exposing keywords to clients  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Exposing keywords to clients  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
On Sat, May 3, 2008 at 6:12 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> Peter Eisentraut <peter_e@gmx.net> writes:
> > Is there anything useful you would do with this information?  Or would you
> > just quote all listed words anyway?

Currently, yes, we just quote all listed words.

> I think the practical application would be to avoid quoting unreserved
> keywords, as pg_dump for instance already does.  I doubt anyone would
> bother distinguishing the different types of partially/wholly reserved
> words.  So maybe a boolean would be sufficient --- but I have nothing
> against the R/T/C/U suggestion.
>
> A more radical alternative is just to omit unreserved words from the
> view altogether.

Well my thinking is that it costs nothing extra bar a dozen lines of
code to include the info now in case it's useful in the future, if not
for pgAdmin, then maybe for Lightning Admin or one of the other tools.
If a need for it arises in the future and we haven't included it now
we'll either want to add a second function or break compatibility both
of which strike me as a lot more objectionable than doing it all now.

Attached is an updated patch, giving the following output. The catdesc
column can be translated.

postgres=# select * from pg_get_keywords();
       word        | catcode |        catdesc
-------------------+---------+-----------------------
 abort             | U       | Unreserved
 all               | R       | Reserved
 bigint            | C       | Column name
 binary            | T       | Type or function name

--
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com

Attachment

pgsql-patches by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: [COMMITTERS] pgsql: Sigh ...
Next
From: Tom Lane
Date:
Subject: Re: Exposing keywords to clients