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