Re: Dynamic loading of Perl Code in Postgres functions

From: "Harpreet Dhaliwal" <harpreet(dot)dhaliwal01(at)gmail(dot)com>
To: "John DeSoi" <desoi(at)pgedit(dot)com>
Cc: "Jasbinder Singh Bali" <jsbali(at)gmail(dot)com>, "Adam Rich" <adam(dot)r(at)sbcglobal(dot)net>, pgsql-general(at)postgresql(dot)org
Subject: Re: Dynamic loading of Perl Code in Postgres functions
Date: 2007-01-16 20:55:22
Message-ID: d86a77ef0701161255q52107983m8bd0ac78e5c461a3@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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;

To include abc.pl here, how is the path of abc.pl specified. Also,
just wondering if the structure of above function is correct atall at
the first place

~Harpreet

On 1/16/07, John DeSoi <desoi(at)pgedit(dot)com> wrote:
>
> I assume your choices are to include the entire script in a
> PostgreSQL function or simply create a small stub function that calls
> a function you have loaded with use or require (as mentioned by the
> other poster). But either way, you have to create a function so you
> can tell PostgreSQL what to call, what the parameters are, and what
> values should be returned.
>
> John
>
>
>
> On Jan 16, 2007, at 10:25 AM, Jasbinder Singh Bali wrote:
>
> > So there is nothing called dynamic loading of perl code in postgres.
> > I'll have to include the whole perl script in the postgres function
> > you mean?
>
>
>
> John DeSoi, Ph.D.
> http://pgedit.com/
> Power Tools for PostgreSQL
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: Don't 'kill -9' the postmaster
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Stephan Szabo 2007-01-16 20:59:33 Re: Multi-column constraint behaviour
Previous Message Tom Lane 2007-01-16 20:51:58 Re: Multi-column constraint behaviour