Re: Arrays of Complex Types

From: David Fetter <david(at)fetter(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PG Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Arrays of Complex Types
Date: 2007-03-27 19:39:04
Message-ID: 20070327193904.GE10585@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

On Tue, Mar 27, 2007 at 11:08:44AM -0700, David Fetter wrote:
> On Sun, Mar 25, 2007 at 10:18:14PM -0400, Tom Lane wrote:
> > David Fetter <david(at)fetter(dot)org> writes:
> > > I've written up a patch intended to implement this on the
> > > non-pg_catalog tables and VIEWs, but while it builds, it doesn't
> > > initdb. Enclosed are the patch and the error log.
> > > Any hints as to what I might look at?
> >
> > > creating template1 database in /var/lib/pgsql/pgsql/src/test/regress/./tmp_check/data/base/1 ... ok
> > > initializing pg_authid ... ok
> > > initializing dependencies ... ok
> > > creating system views ... ok
> > > loading system objects' descriptions ... FATAL: cache lookup failed for type 11096
> > > child process exited with exit code 1
> >
> > That step of initdb creates a TEMP table ... maybe your patch
> > doesn't work for temp tables? Anyway, you're certainly far enough
> > along there that you could fire up the postmaster and reproduce
> > the error in a normal debugging environment.
>
> I've done that, and thanks to Andrew of Supernews, I've got a
> slightly better patch, albeit one that bombs out at the same spot.
> In the patch attached, it appears that TypeCreate is not doing the
> right thing in pg_depend, either because I'm not invoking it right
> or because it needs more machinery.
>
> Any ideas?

Pardon the self-follow-up.

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.

It now initdb's successfully, but fails on a lot of regression tests.

Please find attached the new patch vs. CVS TIP and the regression test
output.

Am I on the right track here?

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 3.9 KB
regression.out text/plain 4.6 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joris Dobbelsteen 2007-03-27 19:51:31 Re: Guarenteeing complex referencial integrity throughcustom triggers
Previous Message Simon Riggs 2007-03-27 19:11:21 Re: sorted results on pgbuildfarm

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2007-03-27 20:08:33 Re: [pgsql-patches] O_DIRECT support for Windows
Previous Message Holger Schurig 2007-03-27 19:36:57 [PATCH] add CLUSTER table ORDER BY index