Re: Converting a plperlu function to a plpgsql function - Mailing list pgsql-sql

From Joe Conway
Subject Re: Converting a plperlu function to a plpgsql function
Date
Msg-id 410005F7.2040109@joeconway.com
Whole thread Raw
In response to Converting a plperlu function to a plpgsql function  (Devin Whalen <devin@synapticvision.com>)
Responses Re: Converting a plperlu function to a plpgsql function  (Jeff Eckermann <jeff_eckermann@yahoo.com>)
List pgsql-sql
Devin Whalen wrote:
> First line:
> my @active_tables=split(/,/,$tables);
> 
> Is there anyway to split a variable like the perl split above?

I'm no perl guru, but in 7.4 I believe this does what you're looking for:

regression=# select string_to_array('1,2,3',','); string_to_array
----------------- {1,2,3}
(1 row)

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

Not sure about this one. Hopefully someone else can chime in. Maybe a 
little less efficient, but it seems like it would be easy enough to 
parse when true.

HTH,

Joe


pgsql-sql by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: Problem with transaction in functions and tempory tables
Next
From: Jeff Eckermann
Date:
Subject: Re: Converting a plperlu function to a plpgsql function