By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,661 Members | 1,330 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,661 IT Pros & Developers. It's quick & easy.

any chance of "like ANY (array[])" like the "= ANY (array[])" syntax?

P: n/a

I find myself wishing I had a syntax "LIKE ANY (array['foo','bar'])".

I don't see much value in the = ANY, = ALL, <> ANY, <> ALL syntax since
they're equivalent more or less to IN and NOT IN. But it could be neat if
other operators were supported.

As it turns out this isn't immediately relevant, it will only be relevant when
one day the database drivers use the binary FE protocol and support binding
arrays directly. Then I could pass an application-level array to postgresql as
an array directly.

Currently I think it would still have to be quoted which would mean I may as
well just pass a fixed maximum number of search elements anyways. Unless
there's a better option I haven't thought of.

--
greg
---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 11 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Greg Stark <gs*****@mit.edu> writes:
I find myself wishing I had a syntax "LIKE ANY (array['foo','bar'])".


You do, because LIKE has an equivalent operator.

foo ~~ ANY (array[])

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 11 '05 #2

P: n/a
Greg Stark <gs*****@mit.edu> writes:
I find myself wishing I had a syntax "LIKE ANY (array['foo','bar'])".


You do, because LIKE has an equivalent operator.

foo ~~ ANY (array[])

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 11 '05 #3

P: n/a
Tom Lane <tg*@sss.pgh.pa.us> writes:
Greg Stark <gs*****@mit.edu> writes:
I find myself wishing I had a syntax "LIKE ANY (array['foo','bar'])".


You do, because LIKE has an equivalent operator.

foo ~~ ANY (array[])


Yippee! Thanks.

--
greg
---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 11 '05 #4

P: n/a
Tom Lane <tg*@sss.pgh.pa.us> writes:
Greg Stark <gs*****@mit.edu> writes:
I find myself wishing I had a syntax "LIKE ANY (array['foo','bar'])".


You do, because LIKE has an equivalent operator.

foo ~~ ANY (array[])


Yippee! Thanks.

--
greg
---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 11 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.