Peter Nixon wrote:
> radius=# create function testperltest3 (text) returns text as '
> radius'# my $datetime = $_[0];
> radius'# # Remove . from the start of time fields (routers that
have
> lost ntp timesync)
> radius'# $datetime =~ s/^\.*//;
> radius'# return $datetime;
> radius'# ' language 'plperl';
> CREATE FUNCTION
> radius=# select testperltest3('.16:46:02.356 EET Wed Dec 11 2002');
> testperltest3
> ---------------
>
> (1 row)
The backslash is being treated as an escape character by Postgres when the
function is created, and hence is not present in the actual function code.
Try doubling it.
--
Peter Gibbs
EmKel Systems