dbTalk Databases Forums  

[BUGS] missing support for using regex and arrays

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] missing support for using regex and arrays in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Pavel Stehule
 
Posts: n/a

Default [BUGS] missing support for using regex and arrays - 05-11-2004 , 02:51 AM






Hello

I need to solve checking varchar array. I can write

CHECK('aaa' = ALL(x)) -- x is array
but I can't CHECK(ALL(x) = 'aaaa') or CHECK (ALL(x) ~ 'regex')

I know so I can write plpgsql function. I have question for hackers. Do
You plan better support for it?

Thank You
Pavel Stehule


---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Reply With Quote
  #2  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] missing support for using regex and arrays - 05-11-2004 , 06:55 AM






Pavel Stehule <stehule (AT) kix (DOT) fsv.cvut.cz> writes:
Quote:
I need to solve checking varchar array. I can write
CHECK('aaa' = ALL(x)) -- x is array
but I can't CHECK(ALL(x) = 'aaaa') or CHECK (ALL(x) ~ 'regex')
I know so I can write plpgsql function. I have question for hackers. Do
You plan better support for it?
No. The ALL keyword has to follow the operator it applies to --- the
syntax is not just "all(something)" but "something op all(something)".
I don't think we can relax that without creating syntactic ambiguity.

If you want to work with non-commutative operators such as regex, you
may need to invent your own operator.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo (AT) postgresql (DOT) org so that your
message can get through to the mailing list cleanly


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.