Array, ANY and Regular Expressions

From: Stefan 'Kaishakunin' Schumacher <stefan(at)net-tex(dot)de>
To: pgsql-general(at)postgresql(dot)org
Subject: Array, ANY and Regular Expressions
Date: 2008-08-23 10:53:33
Message-ID: 20080823105333.GA3070@bladerunner.kaishakunin.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Peter Eisentraut 2008-08-23 12:38:50 Re: [GENERAL] Surprising syntax error
Previous Message Stefan Kaltenbrunner 2008-08-23 10:51:58 Re: [Q] DNS(bind) ER model