Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-hackers by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group