473,748 Members | 9,599 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 7608
Greg Stark <gs*****@mit.ed u> 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 YourEmailAddres sHere" to ma*******@postg resql.org)

Nov 11 '05 #2
Greg Stark <gs*****@mit.ed u> 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 YourEmailAddres sHere" to ma*******@postg resql.org)

Nov 11 '05 #3
Tom Lane <tg*@sss.pgh.pa .us> writes:
Greg Stark <gs*****@mit.ed u> 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.ed u> 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
2667
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 like the ones defined in the SPARK profile, it allow to build very deterministic applications that support automatic static code analysis and schedulability analysis. http://www.acm.org/pubs/articles/proceedings/ada/289524/p1-dobbing/p1-dobbing.pdf...
6
2119
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
1954
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 the LIKE part of the test by surrounding my textbox field value with a leading and closing %.
2
4203
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 difference with this? Elookup works like DLookup and I copied it from a very old topic: strCriteria = " LIKE '*" & txtCompanyName & "*'" If IsNull(ELookup("CustomerID", "tblCustomers", strCriteria)) Then Thank you. Ming
30
2944
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
6290
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 of values to them based on data submitted from POST Fields. Code below: $_SESSION = array();
8
4760
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. --------------------------------- PROGRAMME -------------------------------- /* K&R2 section 1.9 exercise 1.19
5
2092
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 name="tx_impexp"/> I want to set this var to 1 from my javascript function, so I tried to execute the following line of code:
7
1962
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
8830
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
9321
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9247
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6796
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6074
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4602
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4874
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3312
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2215
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.