pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Devin Whalen <devin@synapticvision.com>
To: pgsql-sql@postgresql.org
Subject: Converting a plperlu function to a plpgsql function
Date: Thu, 22 Jul 2004 10:49:53 -0400
Message-ID: <1090507793.7474.27.camel@192.168.1.80> (raw)

Hello,

I am trying to convert a database function that is written in perl to a 
PL/pgSQL function.  However, there a a couple of lines that I don't
think can be converted.

First line:
my @active_tables=split(/,/,$tables);

Is there anyway to split a variable like the perl split above?

Second line:

 if ($r=~/^-([0-9]?)([A-z_]+)/)
 {
    my $locid = $1;
    my $table = $2;

Is there any way to to regular expressions similar to above.  I need to
be able to save the matches for later use.  I know you can do regular
expressions in sql but I can't find any equivalent for the above.

Now you may be saying that why don't I just leave it in perl?  Well, I
would like to but my boss wants me to convert this to PL/pgSQL....long
story.  Anyway, if it can't be done it can't be done.  But I was just
wondering if anyone has any advice.

Thanks for the help.

Later








-- 
Devin Whalen
Programmer
Synaptic Vision Inc
Phone-(416) 539-0801
Fax- (416) 539-8280
1179A King St. West
Toronto, Ontario
Suite 309 M6K 3C5
Home-(416) 653-3982



view thread (5+ messages)  latest in thread

Message-ID: <1090507793.7474.27.camel@192.168.1.80>
Permalink:  ../1090507793.7474.27.camel@192.168.1.80/
Also on:    postgresql.org/message-id/1090507793.7474.27.camel@192.168.1.80

 · 

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: devin@synapticvision.com
  Subject: Re: Converting a plperlu function to a plpgsql function
  In-Reply-To: <1090507793.7474.27.camel@192.168.1.80>

* 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