Re: query to get the list of key (reserverd) words?

From: "Igor Neyman" <ineyman(at)perceptron(dot)com>
To: "Bill Moran" <wmoran(at)potentialtech(dot)com>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: query to get the list of key (reserverd) words?
Date: 2011-08-04 18:58:10
Message-ID: F4C27E77F7A33E4CA98C19A9DC6722A207E5E24C@EXCHANGE.corp.perceptron.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> -----Original Message-----
> From: Bill Moran [mailto:wmoran(at)potentialtech(dot)com]
> Sent: Thursday, August 04, 2011 8:53 AM
> To: pgsql-general(at)postgresql(dot)org
> Subject: query to get the list of key (reserverd) words?
>
>
> I'm in the unenviable position of needing to check various input to
> ensure that it doesn't contain any PostgreSQL/SQL key words/reserved
> words.
>
> The initial implementation simply made a copy of this table:
> http://www.postgresql.org/docs/8.3/static/sql-keywords-
> appendix.html#KEYWORDS-TABLE
> into a static array in the code. Obviously, this is non-optimal
> because it becomes a manual chore to ensure the list is up to date
> any time new PG releases are made.
>
> Is there a pg_* or other table in the database that I can query for
> this
> list? Or some other automated method that can be employed?
>
> --
> Bill Moran
> http://www.potentialtech.com
> http://people.collaborativefusion.com/~wmoran/

Use pg_get_keywords(OUT word text, OUT catcode "char", OUT catdesc text)

Regards,
Igor Neyman

In response to

Browse pgsql-general by date

  From Date Subject
Next Message David Johnston 2011-08-04 22:23:24 Is there a better way to unnest an entire row?
Previous Message Harald Fuchs 2011-08-04 15:18:03 Re: hstore installed in a separate schema