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

From Joe Abbate
Subject Re: Reserved words and delimited identifiers
Date
Msg-id 4ED657EF.1060300@freedomcircle.com
Whole thread Raw
In response to Re: Reserved words and delimited identifiers  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Reserved words and delimited identifiers
List pgsql-hackers
On 11/30/2011 09:55 AM, Tom Lane wrote:
> One possible solution, if you're getting type information about columns
> from the server, is to cast the type OID to regtype and let the regtype
> output converter make all the decisions.  It's less notation than a join
> to pg_type anyway.

Unfortunately, Pyrseas' yamltodb gets (some) type information from a
YAML input file, so we can't do that.  However, since user defined TYPEs
are processed before TABLE definitions, we could search for TYPEs in the
parallel catalogs (Python dictionaries) maintained in memory.  So, given
this:

schema public: description: standard public schema table myuser:   columns:   - info:       type: user type user:
attributes:  - name: text   - pass: text
 

we could generate the following SQL against an empty database:

CREATE TYPE "user" AS (name text,   pass text);
CREATE TABLE myuser (   info "user");

Joe


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: review: CHECK FUNCTION statement
Next
From: "Kevin Grittner"
Date:
Subject: Re: Reserved words and delimited identifiers