Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XJrVF-0007uC-Dy for pgsql-bugs@arkaria.postgresql.org; Tue, 19 Aug 2014 22:03:41 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XJrVE-0005o4-L2 for pgsql-bugs@arkaria.postgresql.org; Tue, 19 Aug 2014 22:03:40 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XJj90-0005AJ-Uo for pgsql-bugs@postgresql.org; Tue, 19 Aug 2014 13:08:11 +0000 Received: from wrigleys.postgresql.org ([204.145.124.246]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XJj8t-00021y-0W for pgsql-bugs@postgresql.org; Tue, 19 Aug 2014 13:08:09 +0000 MIME-Version: 1.0 Subject: BUG #11211: regexp_matches acts like a WHERE To: pgsql-bugs@postgresql.org From: mail@eduard-wulff.de Date: Tue, 19 Aug 2014 13:08:01 +0000 Message-ID: <20140819130801.2534.30713@wrigleys.postgresql.org> X-Pg-Spam-Score: -1.9 (-) Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org The following bug has been logged on the website: Bug reference: 11211 Logged by: Eduard Wulff Email address: mail@eduard-wulff.de PostgreSQL version: 9.4beta2 Operating system: Debian testing AMD64 Description: SELECT vorgangt.id, (regexp_matches(vorgangt.text, '#\w{5,26}', 's'))[1] AS sernr, regexp_replace(vorgangt.text, '\n', '⁋', 'g') AS text_in_einer_zeile FROM vorgangt ORDER BY 1 This works to get the first match if there is one. BUT: it also _eliminates_ all rows that do not match from the result set EXPECTED: return NULL or at least an empty string if there is no match -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs