Skip site navigation (1) Skip section navigation (2)

Re: Reserved words and delimited identifiers

From: Joe Abbate <jma(at)freedomcircle(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Reserved words and delimited identifiers
Date: 2011-11-30 16:21:03
Message-ID: (view raw, whole thread or download thread mbox)
Lists: 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

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

we could generate the following SQL against an empty database:

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


In response to


pgsql-hackers by date

Next:From: Kevin GrittnerDate: 2011-11-30 16:26:09
Subject: Re: Reserved words and delimited identifiers
Previous:From: Tom LaneDate: 2011-11-30 16:19:05
Subject: Re: review: CHECK FUNCTION statement

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group