Re: Reserved words and delimited identifiers - Mailing list pgsql-hackers

From Joe Abbate
Subject Re: Reserved words and delimited identifiers
Date
Msg-id 4ED6699B.4020105@freedomcircle.com
Whole thread Raw
In response to Re: Reserved words and delimited identifiers  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Responses Re: Reserved words and delimited identifiers
List pgsql-hackers
On 11/30/2011 11:26 AM, Kevin Grittner wrote:
> You are prepared to handle the difference between char and "char", I
> hope.

We have not implemented a type "verifier" in Pyrseas.  It currently
generates SQL based on the type given in the input.  In normal usage,
dbtoyaml is expected to be invoked first, and it will generate quoted
types if necessary, e.g.,

schema public: description: standard public schema table myuser:   columns:   - info:       type: '"user"'   - active:
    type: '"char"'   - logons:       type: integer type user:   attributes:   - name: text   - pass: text
 

The quotes above are because it selects format_type(atttypid, atttypmod)
from pg_attribute.  The YAML output can then be fed into yamltodb and
will generate (assuming the "user" type and the first column of myuser
already exist):

ALTER TABLE myuser   ADD COLUMN active "char";
ALTER TABLE myuser   ADD COLUMN logons integer;

In other words, Pyrseas depends on the ultimate type verifier: the
PostgreSQL parser (and related routines).

Joe


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Large number of open(2) calls with bulk INSERT into empty table
Next
From: Jeff Davis
Date:
Subject: Re: Why so few built-in range types?