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

Re: Polymorphic arguments and composite types

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Polymorphic arguments and composite types
Date: 2007-10-05 16:46:34
Message-ID: 1191602794.18360.8.camel@dogma.ljc.laika.com (view raw or flat)
Thread:
Lists: pgsql-hackers
On Fri, 2007-10-05 at 12:29 -0400, Tom Lane wrote:
> Jeff Davis <pgsql(at)j-davis(dot)com> writes:
> > You could do something like:
> > SELECT * FROM c AS c1, c AS c2 WHERE ARRAY[c1.col1] <@ ANY(SELECT c2.col2);
> 
> Good point --- actually he could convert it back to the original
> subselect style, as long as he's using the correct operator:
> 
> SELECT * FROM c WHERE ARRAY[col1] <@ ANY(SELECT col2 FROM c);

You're right, that's a better example.

> 
> The one-element-array trick seems a bit awkward though.  I wonder
> why we don't have an "anyelement <@ anyarray" kind of operator...
> 

I thought we did -- until I decided to test my example in psql before
hitting "send". It certainly makes sense to me that we should have it.

Regards,
	Jeff Davis


In response to

Responses

pgsql-hackers by date

Next:From: Simon RiggsDate: 2007-10-05 17:04:54
Subject: Re: Polymorphic arguments and composite types
Previous:From: Tom LaneDate: 2007-10-05 16:29:59
Subject: Re: Polymorphic arguments and composite types

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