Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Patches > Re: Exposing ke...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 3674 of 3917
Post > Topic >>

Re: Exposing keywords to clients

by alvherre@[EMAIL PROTECTED] (Alvaro Herrera) May 2, 2008 at 07:24 PM

Dave Page wrote:
> Hi,
> 
> 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 sup****t multiple server versions.

FWIW pg_dump has fmtId() which does something related.

I think it's a bit bogus to be using the list as compiled client-side,
precisely due to the theoretical chance that it could change from one
server version to the next, but it's probably not very likely that we
ever remove a keyword from the server grammar.  And highlighting a
keyword that's not really a keyword is unlikely to be a problem in
practice -- in fact it makes it obvious that the user is likely to be in
trouble later when they upgrade.


> 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.

Perhaps use a separate string for machine parse (say R, T, C, U), and
let the string be translatable.


-- 
Alvaro Herrera                               
http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

-- 
Sent via pgsql-patches mailing list (pgsql-patches@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-patches
 




 2 Posts in Topic:
Re: Exposing keywords to clients
alvherre@[EMAIL PROTECTED  2008-05-02 19:24:21 
Re: Exposing keywords to clients
tgl@[EMAIL PROTECTED] (T  2008-05-02 20:26:10 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan13V112 Thu Jul 24 7:13:14 CDT 2008.