473,396 Members | 1,921 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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


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
4 7582
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Marc Le Roy | last post by:
Hello, ADA Ravenscar is a restricted subset of the ADA language that has been defined for real-time software development in safety critical applications. Completed with additional restrictions...
6
by: sonic | last post by:
what exactly is the difference ? I think that is more suitable for declarative arrays, but not exactly sure why. TIA
4
by: mosscliffe | last post by:
I have been messing with the above all afternoon. I must just be thick I am using an AccessDataSource I have tried modifying the select but I can not find the right syntax to concatenate...
2
by: swingingming | last post by:
Hi, When I am playing around with options, I came across with enabling "SQL server compatible syntax". After I enable this, I could not get one of my query to run. Can anyone explain the subtle...
30
by: josh | last post by:
Hi all, what does it meaning that strange sintax (look at the object :) ? if I have i.e. array.length I can use array. and is it IE/Firefox compatible??
26
by: drako | last post by:
Hi, I'm a bit stumped as I am getting a "Notice: Array to String Conversion" error when trying to do something that on the surface should be a very simple task - create an array, and write a set...
8
by: arnuld | last post by:
i have created a solutions myself. it compiles without any trouble and runs but it prints some strange characters. i am not able to find where is the trouble. ...
5
by: Diego Pino | last post by:
Hello, I am experience some problems reading a form variable from a Javascript function. The point with this particular variable is that its name has the following syntax: <input...
7
by: Giakko | last post by:
hello, is there a way to create an array in this way?: new Array('key1'='value1','key2'='value2','key3'='value3') ?????? thanks, simone, http://www.notte.com
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.