Saturday, August 23, 2008

[GENERAL] Array, ANY and Regular Expressions

I have a table with an array column (tags text[]) which I want to
select from via ANY and RegExes.

SELECT tags from zettelkasten where 'Sozialpsychologie' ~* any(tags) order by
ident;

delivers 7 rows

SELECT tags from zettelkasten where 'SoziALPSychologie---FOOBARBAZ' ~* any(tags)
order by ident;

also delivers 7 rows,

however:

SELECT tags from zettelkasten where 'sozial' ~* any(tags) order by ident;

delivers 0 rows.


So how do I select all entries from "zettelkasten" tagged with
e.g. '*psycholog*'?


PS: Keep me CC:'ed, I am not subscribed to this list

mit freundlichen Grüßen
Stefan Schumacher
--
https://deepsec.net/schedule/

Desing and Implementation of Security Awareness Campaigns at
DeepSec Security Conference Vienna/Austria 2008-11-11

No comments: