Re: indexes on varchar fields - Mailing list pgsql-general

From Peter Gibbs
Subject Re: indexes on varchar fields
Date
Msg-id 025601c2a1e7$4111d440$0b01010a@emkel.co.za
Whole thread Raw
In response to Re: indexes on varchar fields  ("Nigel J. Andrews" <nandrews@investsystems.co.uk>)
List pgsql-general
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


pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Is it possible to Import tables and its data from Ms Access
Next
From: "James F"
Date:
Subject: Re: Is it possible to Import tables and its data from Ms Access