Re: Dynamic loading of Perl Code in Postgres functions - Mailing list pgsql-general

From Tom Lane
Subject Re: Dynamic loading of Perl Code in Postgres functions
Date
Msg-id 26320.1168983160@sss.pgh.pa.us
Whole thread Raw
In response to Re: Dynamic loading of Perl Code in Postgres functions  ("Harpreet Dhaliwal" <harpreet.dhaliwal01@gmail.com>)
Responses Re: Dynamic loading of Perl Code in Postgres functions
List pgsql-general
"Harpreet Dhaliwal" <harpreet.dhaliwal01@gmail.com> writes:
> I was just wondering if one could use something like this

> CREATE FUNCTION *funcname* (*argument-types*) RETURNS *return-type* AS $$
>     require "abc.pl"
> $$ LANGUAGE plperl;

You'd have to use plperlu, since "require" isn't considered a trusted
operation.

> To include abc.pl here, how is the path of abc.pl specified.

Same as you'd do it in plain Perl.

            regards, tom lane

pgsql-general by date:

Previous
From: Nathan Bell
Date:
Subject: 8.1 vs 8.2.1 view optimization
Next
From: Tom Lane
Date:
Subject: Re: 8.1 vs 8.2.1 view optimization