Skip site navigation (1) Skip section navigation (2)

Exposing keywords to clients

From: "Dave Page" <dpage(at)pgadmin(dot)org>
To: pgsql-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Exposing keywords to clients
Date: 2008-05-02 20:54:56
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-patches

The attached patch implements a new function, pg_get_keywords(), which
returns a set of records describing the keywords recognised by the
server. This allows clients such as pgAdmin to get quoting rules
correct, and helps with other tasks such as syntax highlighting where
we need to support multiple server versions.

Example output (edited of course):

postgres=# select * from pg_get_keywords();
       word        |       category
 all               | Reserved
 binary            | Type or function name
 xmlserialize      | Column name
 zone              | Unreserved
(372 rows)

I wasn't sure about the best way to describe the categories -
obviously they need to be non-translatable (for client software to
interpret), but human readable is also nice. I'm happy to hear
alternate suggestions.

Dave Page
EnterpriseDB UK:

Attachment: pg_get_keywords.diff
Description: text/plain (6.0 KB)


pgsql-patches by date

Next:From: Tom LaneDate: 2008-05-02 21:13:38
Subject: Re: [HACKERS] GUC parameter cursors_tuple_fraction
Previous:From: Simon RiggsDate: 2008-05-02 20:49:39
Subject: Re: [HACKERS] GUC parameter cursors_tuple_fraction

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group