Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 9928DB5D95B for ; Tue, 14 Jun 2011 13:31:36 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 02236-02 for ; Tue, 14 Jun 2011 16:31:36 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from wwwmaster.postgresql.org (wwwmaster.postgresql.org [217.196.146.204]) by mail.postgresql.org (Postfix) with ESMTP id D65A6B5D80B for ; Tue, 14 Jun 2011 13:31:35 -0300 (ADT) Received: from wwwmaster.postgresql.org (wwwmaster.postgresql.org [217.196.146.204]) by wwwmaster.postgresql.org (8.14.3/8.14.3) with ESMTP id p5EGVY3V056731 for ; Tue, 14 Jun 2011 16:31:34 GMT (envelope-from www@wwwmaster.postgresql.org) Received: (from www@localhost) by wwwmaster.postgresql.org (8.14.3/8.14.3/Submit) id p5EGVYnk056729; Tue, 14 Jun 2011 16:31:34 GMT (envelope-from www) Date: Tue, 14 Jun 2011 16:31:34 GMT Message-Id: <201106141631.p5EGVYnk056729@wwwmaster.postgresql.org> To: pgsql-bugs@postgresql.org Subject: BUG #6057: regexp_replace & back references From: "Marc Mamin" Content-Type: text/plain; charset=utf-8 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 201106/107 X-Sequence-Number: 30486 The following bug has been logged online: Bug reference: 6057 Logged by: Marc Mamin Email address: marc@intershop.de PostgreSQL version: 9.0.4 Operating system: Windows Description: regexp_replace & back references Details: select regexp_replace ('a','(a)','\\1'||substring('\\1',1,1)||'\\1','g') = a\1 I'd expect a\1a as result. More generally, I miss the avaibility to use back references as function parameters. It is only possible with some operators (e.g. '\\1'||'\\1'), probably depending on their lexical precedence. Any way to workaround this limitation would be very helpful. HTH, Marc Mamin