Re: searching array - Mailing list pgsql-general

From Tom Lane
Subject Re: searching array
Date
Msg-id 12443.1129522878@sss.pgh.pa.us
Whole thread Raw
In response to searching array  (Matthew Peter <survivedsushi@yahoo.com>)
List pgsql-general
Matthew Peter <survivedsushi@yahoo.com> writes:
> I was trying to search a array with a GTE to value and
> it doesn't work. Is this supported? Or am I missing
> something?

> SELECT * FROM sal_emp WHERE 10000 >= ALL (pay_by_quarter);

Define "doesn't work".  Do you get an error --- if so, what exactly?
Do you get unexpected results --- if so, what?  And what version of
Postgres are you using?

AFAIK it works in 7.4 and up:

regression=# select 100 >= all(array[1,2,4]);
 ?column?
----------
 t
(1 row)

regression=# select 100 >= all(array[1,2,101]);
 ?column?
----------
 f
(1 row)


            regards, tom lane

pgsql-general by date:

Previous
From: Chris Travers
Date:
Subject: Re: PostgreSQL Gotchas
Next
From: Brent Wood
Date:
Subject: Re: graphs in PostgreSQL