pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Joe Conway <mail@joeconway.com>
To: Kumar <sgnerd@yahoo.com.sg>
Cc: psql <pgsql-sql@postgresql.org>
Subject: Re: Equivalent of Reverse() functions
Date: Wed, 26 Nov 2003 23:24:36 -0800
Message-ID: <3FC5A6B4.70600@joeconway.com> (raw)
In-Reply-To: <00cb01c3b4b2$c23d9520$7502a8c0@hdsc.com>
References: <00cb01c3b4b2$c23d9520$7502a8c0@hdsc.com>

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





view thread (3+ messages)  latest in thread

Message-ID: <3FC5A6B4.70600@joeconway.com>
Permalink:  ../3FC5A6B4.70600@joeconway.com/
Also on:    postgresql.org/message-id/3FC5A6B4.70600@joeconway.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: mail@joeconway.com, sgnerd@yahoo.com.sg
  Subject: Re: Equivalent of Reverse() functions
  In-Reply-To: <3FC5A6B4.70600@joeconway.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox