Re: Equivalent of Reverse() functions

From: Joe Conway <mail(at)joeconway(dot)com>
To: Kumar <sgnerd(at)yahoo(dot)com(dot)sg>
Cc: psql <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Equivalent of Reverse() functions
Date: 2003-11-27 07:24:36
Message-ID: 3FC5A6B4.70600@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Kaloyan Iliev Iliev 2003-11-27 08:01:27 Unsigned numbers
Previous Message Kumar 2003-11-27 06:50:24 Equivalent of Reverse() functions