Re: Exposing keywords to clients

Поиск
Список
Период
Сортировка
Искать
От
Dave Page
Тема
Re: Exposing keywords to clients
Дата
в 16:45:06
Msg-id
937d27e10805031244h5f08a772l77e0f35b019b4f31@mail.gmail.com
Ответ на
Список
Дерево обсуждения
Exposing keywords to clients "Dave Page" <dpage@pgadmin.org>
Re: Exposing keywords to clients Alvaro Herrera <alvherre@commandprompt.com>
Re: Exposing keywords to clients Tom Lane <tgl@sss.pgh.pa.us>
Re: Exposing keywords to clients "Dave Page" <dpage@pgadmin.org>
Re: Exposing keywords to clients Peter Eisentraut <peter_e@gmx.net>
Re: Exposing keywords to clients Tom Lane <tgl@sss.pgh.pa.us>
Re: Exposing keywords to clients "Dave Page" <dpage@pgadmin.org>
Re: Exposing keywords to clients Tom Lane <tgl@sss.pgh.pa.us>
Re: Exposing keywords to clients Tom Lane <tgl@sss.pgh.pa.us>
Re: Exposing keywords to clients "Dave Page" <dpage@pgadmin.org>
Re: Exposing keywords to clients Nikhils <nikkhils@gmail.com>
Re: Exposing keywords to clients Tom Lane <tgl@sss.pgh.pa.us>
On Sat, May 3, 2008 at 6:12 PM, Tom Lane  wrote:
>
> Peter Eisentraut  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
В списке pgsql-patches по дате отправления
От: Magnus Hagander
Дата:
От: Tom Lane
Дата:
FAQ