X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 3ACDCD1B473 for ; Thu, 27 Nov 2003 07:27:00 +0000 (GMT) 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 39378-10 for ; Thu, 27 Nov 2003 03:26:32 -0400 (AST) Received: from joeconway.com (66-146-172-86.skyriver.net [66.146.172.86]) by svr1.postgresql.org (Postfix) with ESMTP id 2A5D3D1B480 for ; Thu, 27 Nov 2003 03:26:31 -0400 (AST) Received: from [192.168.5.3] (account jconway HELO joeconway.com) by joeconway.com (CommuniGate Pro SMTP 4.1.8) with ESMTP-TLS id 674256; Wed, 26 Nov 2003 23:24:22 -0800 Message-ID: <3FC5A6B4.70600@joeconway.com> Date: Wed, 26 Nov 2003 23:24:36 -0800 From: Joe Conway User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3) Gecko/20030312 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Kumar Cc: psql Subject: Re: Equivalent of Reverse() functions References: <00cb01c3b4b2$c23d9520$7502a8c0@hdsc.com> In-Reply-To: <00cb01c3b4b2$c23d9520$7502a8c0@hdsc.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200311/300 X-Sequence-Number: 16115 Kumar wrote: > I am migrating an SQL Server 2000 database to Postgres 7.3.4 running > on RH Linux 7.2. While migrating I encounter SQL Server REVERSE( ) > function, seems no such functions at Postgres. > > Is there a equivalent function available at Postgres? Please shed > some light How about: create or replace function reverse(text) returns text as ' return reverse($_[0]); ' language plperl; regression=# select reverse('abcdef'); reverse --------- fedcba (1 row) Joe