X-Original-To: pgsql-sql-postgresql.org@postgresql.org Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 3BB4C9FA222 for ; Wed, 6 Sep 2006 14:14:06 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 92300-02-5 for ; Wed, 6 Sep 2006 17:14:02 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from 137086.vserver.de (vs137086.vserver.de [62.75.137.86]) by postgresql.org (Postfix) with ESMTP id 0BE3C9F9F79 for ; Wed, 6 Sep 2006 14:08:53 -0300 (ADT) Received: from a-kretschmer.de (p54B38E42.dip0.t-ipconnect.de [84.179.142.66]) (authenticated bits=0) by 137086.vserver.de (8.12.8/8.12.8) with ESMTP id k86H8jrV032640 for ; Wed, 6 Sep 2006 19:08:46 +0200 Received: from kretschmer by a-kretschmer.de with local (Exim 4.61) (envelope-from ) id 1GL0tk-00055u-8n for pgsql-sql@postgresql.org; Wed, 06 Sep 2006 19:09:12 +0200 Date: Wed, 6 Sep 2006 19:09:12 +0200 From: Andreas Kretschmer To: pgsql-sql@postgresql.org Subject: Re: Substitute a Character Message-ID: <20060906170912.GA18152@KanotixBox> References: <44FEFCFA.8010501@correolux.com.mx> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <44FEFCFA.8010501@correolux.com.mx> X-OS: Debian/GNU Linux - weil ich es mir Wert bin! X-GPG-Fingerprint: EE16 3C01 7B9C 10F7 2C8B 3B86 4DB3 D9EE 7F45 84DA X-Message-Flag: "Windows" is not the answer. "Windows" is the question and the answer is "no"! X-Lugdd: Gerd Kube X-Info: My name is root. Just root. And I am licensed to kill -9 User-Agent: mutt-ng 1.5.9i (Linux) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.135 tagged_above=0 required=5 tests=FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200609/36 X-Sequence-Number: 26247 Judith schrieb: > Hello everybody!! I have a field type text with folios like this: > A98526 > > but I want to change de A for a 0 like this: 098526, exists a way to do > this in a query??? Perhaps something like this: test=# select regexp_replace('A98526', '^.', '0'); regexp_replace ---------------- 098526 (1 row) http://www.postgresql.org/docs/8.1/interactive/functions-matching.html#FUNCTIONS-POSIX-REGEXP Andreas -- Really, I'm not out to destroy Microsoft. That will just be a completely unintentional side effect. (Linus Torvalds) "If I was god, I would recompile penguin with --enable-fly." (unknow) Kaufbach, Saxony, Germany, Europe. N 51.05082°, E 13.56889°