Question about the ANY operator - Mailing list pgsql-general

From Mike Christensen
Subject Question about the ANY operator
Date
Msg-id 7aa638e00912210246p29bba173wea0488931d2fe7ac@mail.gmail.com
Whole thread Raw
Responses Re: Question about the ANY operator  (Martijn van Oosterhout <kleptog@svana.org>)
List pgsql-general
I'm having trouble figuring out the ANY operator..  Basically I want to return rows that match any of the given IDs:

select Name from Users where UserId = ANY ARRAY['948aeda5-ffff-41bd-af4e-71d1c740db76', '5ee315ea-7ef6-4fa5-809a-dc9931a01ed1']::uuid[];

I get the syntax error:

ERROR:  syntax error at or near "ARRAY"
LINE 1: ...* from Users where UserId = ANY ARRAY['948...

I know I could just use a bunch of OR clauses, but I want to pass in this array as a variable.  Any clue as to what I'm doing wrong?

Mike

pgsql-general by date:

Previous
From: Alban Hertroys
Date:
Subject: Re: Charset Win1250 on Windows and Ubuntu
Next
From: Ivan Voras
Date:
Subject: Re: Something like Oracle Forms, but Open Source to use with PostgreSQL?