[GENERAL] Searching array for multiple items - Mailing list pgsql-general

From Alex Magnum
Subject [GENERAL] Searching array for multiple items
Date
Msg-id CA+cR4zdtT_Yx5NhMGxnjDHWAn6iG4kjy=k7T8uuJBZPma7ov3Q@mail.gmail.com
Whole thread Raw
Responses Re: [GENERAL] Searching array for multiple items  (Oleg Bartunov <obartunov@gmail.com>)
Re: [GENERAL] Searching array for multiple items  (Thomas Kellerer <spam_eater@gmx.net>)
List pgsql-general
Hi,
I can search an array with 1 = ANY('{1,3,4,7}'::int[])

I need to check for one or multiple items in the array.

e.g. '1,7,3'  = ANY('{1,3,4,7}'::int[]

I do need to check if
a) all items exist in the array
b) at least one item exists in the array

Is there a an operator that allows me to do these two?
Does the order of left and right side matter?
Right now I have a small function but I guess there is a more efficient way.

Thanks for any help.

A


pgsql-general by date:

Previous
From: Johann Spies
Date:
Subject: Re: [GENERAL] What is the purpose of PostGIS on PostgreSQL?
Next
From: Oleg Bartunov
Date:
Subject: Re: [GENERAL] Searching array for multiple items