replace_matches does not return {null}

From: Andreas Gaab <A(dot)Gaab(at)scanlab(dot)de>
To: pgsql sql <pgsql-sql(at)postgresql(dot)org>
Subject: replace_matches does not return {null}
Date: 2011-02-22 11:25:03
Message-ID: 48DA836F3865C54B8FBF424A3B775AF6671A68395D@Exchange-Server
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi,

I tried to order a text-column only by parts of the entries. Therefore I used regexp_matches(), but unfortunately I am loosing rows.

SELECT regexp_matches('abc','[0-9]+'), regexp_matches('123','[0-9]+');

Does not return "{null}, {123}" but no result at all.

Is this behavior expected? How can I work around?

I am running postgres 8.4

Andreas

___________________________________________________________________________

SCANLAB AG
Dr. Andreas Simon Gaab
Entwicklung * R & D

Siemensstr. 2a * 82178 Puchheim * Germany
Tel. +49 (89) 800 746-513 * Fax +49 (89) 800 746-199
mailto:a(dot)gaab(at)scanlab(dot)de * www.scanlab.de<http://www.scanlab.de>

Amtsgericht München: HRB 124707 * USt-IdNr.: DE 129 456 351
Vorstand: Georg Hofner (Sprecher), Christian Huttenloher, Norbert Petschik
Aufsichtsrat (Vorsitz): Dr. Hans J. Langer
___________________________________________________________________________

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2011-02-22 16:39:17 Re: replace_matches does not return {null}
Previous Message Gnanakumar 2011-02-21 11:50:41 Re: Is it possible to get DISTINCT rows from RETURNING clause?