Re: Exposing keywords to clients

From: "Dave Page" <dpage(at)pgadmin(dot)org>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Peter Eisentraut" <peter_e(at)gmx(dot)net>, pgsql-patches(at)postgresql(dot)org, "Alvaro Herrera" <alvherre(at)commandprompt(dot)com>
Subject: Re: Exposing keywords to clients
Date: 2008-05-03 19:44:56
Message-ID: 937d27e10805031244h5f08a772l77e0f35b019b4f31@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

On Sat, May 3, 2008 at 6:12 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> Peter Eisentraut <peter_e(at)gmx(dot)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 Content-Type Size
pg_get_keywords-2.diff text/plain 6.3 KB

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2008-05-03 20:00:51 Re: Exposing keywords to clients
Previous Message Magnus Hagander 2008-05-03 19:20:30 Re: [COMMITTERS] pgsql: Sigh ...