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 82491D1CA49 for ; Mon, 17 May 2004 16:35:13 -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 44958-08 for ; Mon, 17 May 2004 16:34:52 -0300 (ADT) Received: from guinness.cs.stevens-tech.edu (guinness.cs.stevens-tech.edu [155.246.89.8]) by svr1.postgresql.org (Postfix) with ESMTP id 5A0B0D1CA3C for ; Mon, 17 May 2004 16:34:50 -0300 (ADT) Received: from pink-elephant.cs.stevens-tech.edu (pink-elephant.cs.stevens-tech.edu [155.246.81.117]) by guinness.cs.stevens-tech.edu (Postfix) with ESMTP id 6F7A314167C; Mon, 17 May 2004 15:35:18 -0400 (EDT) Received: by pink-elephant.cs.stevens-tech.edu (Postfix, from userid 4405) id 73D428AEF9; Mon, 17 May 2004 15:34:48 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by pink-elephant.cs.stevens-tech.edu (Postfix) with ESMTP id 43E4B8AEAB; Mon, 17 May 2004 15:34:48 -0400 (EDT) Date: Mon, 17 May 2004 15:34:42 -0400 (EDT) From: Yasir Malik To: Kornelije Cc: pgsql-sql@postgresql.org Subject: Re: Replace function ... In-Reply-To: <009501c43c1f$63d39580$b103a8c0@krabuzin> Message-ID: References: <009501c43c1f$63d39580$b103a8c0@krabuzin> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.1 tagged_above=0.0 required=5.0 tests=RCVD_IN_RFCI X-Spam-Level: X-Archive-Number: 200405/152 X-Sequence-Number: 17866 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 > I need to write a function which has to replace a character with two or three other characters .... > You can use the replace function as specified below: replace(string text, from text, to text) text Replace all occurrences in @string of substring @from with substring @to. replace( 'abcdefabcdef', 'cd', 'XX') ==> abXXefabXXef Yasir -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (NetBSD) iQEVAwUBQKkT1+J7vYSSIbWdAQL/5QgAmCdJrYh4YjJFWKeWNk+OEuhpvRNYbRlM tH5dezmUrR4fkM4l2mfrmuIkTT+rqQNyRR3E5PhKyfkbnHdw7/WPalqGSbX1aIfP YZI/RdxH/Aqy+hO+zcUQzSjpYSEyKrmTVGLmRf+tyYg0QdZdAQFd6O9aKWMeCo28 TFKRFAlg+glT/YiN1JiwzF/QygBNmo3g+JDWZ+U8Au+y0fHh/3KeoyLx9ipMSqs/ uBiy8eNjOdAF3ihoydDw2uBpzjwtGv9eeR0Myh8m4Zvx9K239NVSz4s9a+2R1Onf Mr5PK7Te5TG8TLcjJyo35x8yC/57oufNvWoi+Q6Y7cmSxeiEcHzJiw== =xChX -----END PGP SIGNATURE-----