Skip site navigation (1) Skip section navigation (2)

Re: PLPERLU help

From: Michael Wood <esiotrot(at)gmail(dot)com>
To: Atif Jung <atifjung(at)gmail(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: PLPERLU help
Date: 2010-06-30 11:58:39
Message-ID: AANLkTikOfZ6zq8locyJ3GYp0dKg_kFk-2EC__rJUzEdp@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-novice
On 30 June 2010 10:59, Atif Jung <atifjung(at)gmail(dot)com> wrote:
> I have the following SPL written in plperlu which I need help with please.
>
> CREATE or replace FUNCTION validatesubmission(submission_num text) RETURNS
> INTEGER AS $$
>    $ISIS2_USER = "unknown";
>    $cmd = '/isis2/pgbin/valsub ' || '-u' || ISIS2_USER || ' ' ||
> submission_num;

I have never used plperlu, but I suspect your problem is the
concatenation operators you are attempting to use.  Perl uses "." for
concatenating strings, not "||".  So try changing those ||s to dots.

P.S.  What happens if this function is called with something other
than a number?  e.g. what if it includes shell meta-characters?

-- 
Michael Wood <esiotrot(at)gmail(dot)com>

In response to

pgsql-novice by date

Next:From: Kent ThomasDate: 2010-06-30 12:21:54
Subject: null vs empty string
Previous:From: Atif JungDate: 2010-06-30 08:59:31
Subject: PLPERLU help

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group