From: | will trillich <will(at)serensoft(dot)com> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | plperl functions -- can they call each other? |
Date: | 2003-01-29 19:52:18 |
Message-ID: | 20030129195217.GA19944@mail.serensoft.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
create or replace function to_partial_ymd(int2,int2,int2)returns int4 as '
my ($y,$m,$d) = @_;
$m = 0 unless $y;
$m = 0 unless 1 <= $m and $m <= 12;
$d = 0 unless $m;
$d = 0 unless (1 <= $d and
(
# 28 days valid for ANY month:
($d <= 28)
or
# 29 days valid if not february -- or in a leap year
($d <= 29 and ( $m != 2 or $y % 4 == 0 ))
or
# 30 days valid if not february
($d <= 30 and $m != 2)
or
# 31 days valid jan/mar/may/jul/aug/oct/dec
($d <= 31 and $m =~ /^(1|3|5|7|8|10|12)$/)
)
);
return ($y << 16) + ($m << 8) + ($d << 0);
' language 'plperl'; -- '
sure would be nice to have such hefty day-of-month logic just
ONCE, and be able to call it from other functions...
is there still no way for one plperl function to call another plperl
function? (i'm hoping that section 25.3.4 is out-of-date...)
--
There are 10 kinds of people:
ones that get binary, and ones that don't.
will(at)serensoft(dot)com
http://sourceforge.net/projects/newbiedoc -- we need your brain!
http://www.dontUthink.com/ -- your brain needs us!
Looking for a firewall? Do you think smoothwall sucks? You're
probably right... Try the folks at http://clarkconnect.org/ !
From | Date | Subject | |
---|---|---|---|
Next Message | Dave Page | 2003-01-29 20:20:02 | Re: Error when accessing tables with deleted columns |
Previous Message | Justin Clift | 2003-01-29 19:27:51 | Re: Installing PG 7.3.1 on Solaris 8 |