X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 6B12BD1BA6C for ; Thu, 22 Apr 2004 20:05:22 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 65715-07 for ; Thu, 22 Apr 2004 20:05:22 -0300 (ADT) Received: from pw6tiger.de (pw6tiger.de [217.160.140.116]) by svr1.postgresql.org (Postfix) with SMTP id E1A7AD1E135 for ; Thu, 22 Apr 2004 20:05:18 -0300 (ADT) Received: (qmail 29923 invoked by uid 505); 22 Apr 2004 23:05:20 -0000 Received: from vygen@gmx.de by planwerk6 by uid 89 with qmail-scanner-1.14 (virus scan: Clear:. Processed in 0.222983 secs); 22 Apr 2004 23:05:20 -0000 Received: from p508cc343.dip0.t-ipconnect.de (HELO 192.168.1.102) (vygen@planwerk6.de@80.140.195.67) by pw6tiger.de with SMTP; 22 Apr 2004 23:05:19 -0000 From: Janning Vygen To: pgsql-sql@postgresql.org Subject: Is there an easy way to normalize-space with given string functions Date: Fri, 23 Apr 2004 00:59:13 +0200 User-Agent: KMail/1.5.4 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200404230059.14221.vygen@gmx.de> X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=1.6 tagged_above=0.0 required=5.0 tests=RCVD_IN_DSBL, RCVD_IN_NJABL, RCVD_IN_SORBS, RCVD_NUMERIC_HELO X-Spam-Level: * X-Archive-Number: 200404/242 X-Sequence-Number: 17617 Hi, i am looking for something like $ SELECT btrim(replace(' too many spaces! ', '\s+',' '), ''); too many spaces i searched the function list and tried to combine to or more functions, but i miss a replace function which uses regular expressions. Do i have to write my own function or did i miss something? trimming is well supported at the start and end of string, but no trimmin in the middle seems to be possible. kind regards janning