join problem...

Started by rikiabout 19 years ago2 messagesgeneral
Jump to latest
#1riki
riki_fox@hotmail.com

Hi,

i'm trying to extract some info from system catalog tables.
documentation says that i should join columns of different data type.
that is int2[] with int2, array with integer.
how can i make this join work?

thanks

http://www.postgresql.org/docs/7.4/static/catalog-pg-constraint.html

conkey int2[] pg_attribute.attnum If a table constraint, list of
columns which the constraint constrains

#2Martijn van Oosterhout
kleptog@svana.org
In reply to: riki (#1)
Re: join problem...

On Wed, Jan 10, 2007 at 04:34:00PM +0100, riki wrote:

Hi,

i'm trying to extract some info from system catalog tables.
documentation says that i should join columns of different data type.
that is int2[] with int2, array with integer.
how can i make this join work?

You can use the ANY() operator for this:

# select 1 = ANY( ARRAY[2,3,4] );
?column?
----------
f
(1 row)

# select 2 = ANY( ARRAY[2,3,4] );
?column?
----------
t
(1 row)

Have a nice day,
--
Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/

Show quoted text

From each according to his ability. To each according to his ability to litigate.