Re: Proposal: stand-alone composite types

Joe Conway <mail@joeconway.com>

From: Joe Conway <mail@joeconway.com>
To:
Cc: pgsql-hackers <pgsql-hackers@postgreSQL.org>
Date: 2002-08-07T16:55:47Z
Lists: pgsql-hackers
Joe Conway wrote:
> 2. Borrow the needed parts from CREATE and DROP VIEW to implement a new
>    form of the CREATE TYPE command, with syntax something like:
> 
>    CREATE TYPE typename AS ( column_name data_type [, ... ] )
> 
>    This would add a pg_class entry of relkind 'c', and add a new
>    pg_type entry of typtype 'c', with typrelid pointing to the
>    pg_class entry. Essentially, this new stand-alone composite type
>    looks a lot like a view without any rules.

I'm working on stand-alone composite types and running into a 
reduce/reduce problem with the grammer. Any suggestions would be 
appreciated. Here's what I have:

DefineStmt:
   CREATE AGGREGATE func_name definition
   {
     . . .
   }
   | CREATE TYPE_P qualified_name AS
     '(' TableFuncElementList ')'
   {
     CompositeTypeStmt *n = makeNode(CompositeTypeStmt);
     n->typevar = $3;
     n->coldeflist = $6;
     $$ = (Node *)n;
   }

Thanks,

Joe