Re: Arrays of Complex Types

From: David Fetter <david(at)fetter(dot)org>
To: andrew(at)supernews(dot)com
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Arrays of Complex Types
Date: 2007-03-28 16:57:38
Message-ID: 20070328165738.GA5437@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

On Wed, Mar 28, 2007 at 07:05:24AM -0000, Andrew - Supernews wrote:
> On 2007-03-27, David Fetter <david(at)fetter(dot)org> wrote:
> > Per further discussion with Andrew of Supernews and Merlin
> > Moncure, I've added a check for compound types and moved the
> > creation of the array type from DefineRelation in
> > backend/commands/tablecmds.c to heap_create_with_catalog in
> > backend/catalog/heap.c.
>
> You've still got the usage of the relation OID and the relation
> _type_ OID reversed.
>
> The array element type that you pass to TypeCreate must be the
> _type_ OID.

The attached patch takes it down to two regression test failures, also
attached:

The first is in type_sanity, which basically doesn't understand that
complex types now have array types associated with them and thinks
they're orphan array types, so it's actually the test that's not
right.

The second is in alter_table where ALTER TABLE ... SET SCHEMA doesn't
pick up the array types associated with the tables.

Andrew at Supernews also noticed that in general, the array type
doesn't change schemas when its base type does. Is this the intended
behavior? If not, should we change it globally?

Cheers,
D
--
David Fetter <david(at)fetter(dot)org> http://fetter.org/
phone: +1 415 235 3778 AIM: dfetter666
Skype: davidfetter

Remember to vote!
Consider donating to PostgreSQL: http://www.postgresql.org/about/donate

Attachment Content-Type Size
array_of_complex.diff text/plain 11.6 KB
regression.diffs text/plain 5.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2007-03-28 17:11:05 Re: Arrays of Complex Types
Previous Message Pavan Deolasee 2007-03-28 16:54:02 Re: CREATE INDEX and HOT - revised design

Browse pgsql-patches by date

  From Date Subject
Next Message Alvaro Herrera 2007-03-28 17:11:05 Re: Arrays of Complex Types
Previous Message Pavel Stehule 2007-03-28 15:42:02 scrollable cursor support without MOVE statement