From: | Joe Conway <mail(at)joeconway(dot)com> |
---|---|
To: | Jeff Davis <list-pgsql-general(at)empires(dot)org> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: composite types in 7.3 |
Date: | 2002-09-30 23:46:37 |
Message-ID: | 3D98E25D.7080403@joeconway.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Jeff Davis wrote:
> I tried:
> test=> create type mytype as (a int, b text);
> CREATE TYPE
> test=> create table mytable(x mytype,y int);
> CREATE TABLE
>
> It seemed to succeed OK, but did I do anything worthwhile? Since composite
> functions don't have input/output functions, I don't know how to actually
> create a record in mytable.
>
> Are composite functions supposed to be used in this way? I know that composite
> types can be used so that a function can return a record of that type, but is
> there any other use?
Not at the moment. In fact, as of current (meaning by the time beta3 is
packaged up, if it's not already this way in beta2) cvs you'll get:
test=# create type mytype as (a int, b text);
CREATE TYPE
test=# create table mytable(x mytype,y int);
ERROR: Attribute "x" has composite type mytype
There have been brief discussions of allowing composite types as table column
data types in some future release, but nothing serious yet.
Joe
From | Date | Subject | |
---|---|---|---|
Next Message | Williams, Travis L, NPONS | 2002-10-01 00:08:11 | Vacuum question.. |
Previous Message | Martijn van Oosterhout | 2002-09-30 23:41:03 | Re: cursors |