pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Joe Conway <mail@joeconway.com>
To: devin@synapticvision.com
Cc: pgsql-sql@postgresql.org
Subject: Re: Converting a plperlu function to a plpgsql function
Date: Thu, 22 Jul 2004 11:22:47 -0700
Message-ID: <410005F7.2040109@joeconway.com> (raw)
In-Reply-To: <1090507793.7474.27.camel@192.168.1.80>
References: <1090507793.7474.27.camel@192.168.1.80>

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



view thread (5+ messages)  latest in thread

Message-ID: <410005F7.2040109@joeconway.com>
Permalink:  ../410005F7.2040109@joeconway.com/
Also on:    postgresql.org/message-id/410005F7.2040109@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, devin@synapticvision.com
  Subject: Re: Converting a plperlu function to a plpgsql function
  In-Reply-To: <410005F7.2040109@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