Re: WITH RECURSIVE ... CYCLE in vanilla SQL: issues with arrays of rows

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Merlin Moncure" <mmoncure(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: WITH RECURSIVE ... CYCLE in vanilla SQL: issues with arrays of rows
Date: 2008-10-14 14:59:28
Message-ID: 28968.1223996368@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Merlin Moncure" <mmoncure(at)gmail(dot)com> writes:
> Here is another use-case solved by the patch. Previously, there was
> no easy way to index on a composite function result. The following
> works in HEAD:

> create function func(f foo, a out int, b out int) returns record ...

> create index foo_idx on foo(func(foo));

Urk ... "works" for small values of "work", perhaps. Did you try using
the index from a fresh session?

We could support this for named composite types but not for anonymous
record types. I'm not quite sure how to enforce that distinction
considering that the opclass is defined to take "record". Maybe we
should apply CheckAttributeType() to index column types?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2008-10-14 15:19:16 Re: 8.3 .4 + Vista + MingW + initdb = ACCESS_DENIED
Previous Message Merlin Moncure 2008-10-14 14:50:21 Re: WITH RECURSIVE ... CYCLE in vanilla SQL: issues with arrays of rows