Re: Polymorphic arguments and composite types

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Polymorphic arguments and composite types
Date: 2007-10-05 16:17:10
Message-ID: 1191601030.18360.2.camel@dogma.ljc.laika.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, 2007-10-05 at 16:04 +0100, Simon Riggs wrote:
> > select * from c, c as c2 where c.col1 = any (c2.col2)
>
> That works, thanks.
>
> As I said, I already solved the problem a different way. I was looking
> to understand the 3 questions I raised along the way.
>
> Can you throw any light on those questions?
> 1. Why doesn't the subselect work?
>

You could do something like:

SELECT * FROM c AS c1, c AS c2 WHERE ARRAY[c1.col1] <@ ANY(SELECT c2.col2);

Regards,
Jeff Davis

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2007-10-05 16:29:59 Re: Polymorphic arguments and composite types
Previous Message Tom Lane 2007-10-05 15:42:20 Re: Polymorphic arguments and composite types