PL/Perl

Lists: pgsql-general
From: "Brian Maguire" <bmaguire(at)vantage(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Cc: "Kevin MacClay" <kmacclay(at)vantage(dot)com>
Subject: J2SE 1.5 Cache Rowset(JSR 114 )
Date: 2005-01-07 15:23:12
Message-ID: 4BAFBB6B9CC46F41B2AD7D9F4BBAF7850DE253@vt-pe2550-001.vantage.vantage.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Just as an FYI. Sun's Cache rowset which is new and part of the J2SE 1.5 is not compatable with Postgres. We have been working with Sun's JAVA development team to resolve the issues through our test cases and debugging. We hope that in a future patch update that the issues will be resolved. We'll keep you up to date.

Brian


From: Pavel Stehule <stehule(at)kix(dot)fsv(dot)cvut(dot)cz>
To: "ON(dot)KG" <skyer(at)on(dot)kg>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: PL/Perl
Date: 2005-01-07 16:36:30
Message-ID: Pine.LNX.4.44.0501071735500.21154-100000@kix.fsv.cvut.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Hello,
you have to use plperlu, untrusted plperl

regards
Pavel Stehule

On Fri, 7 Jan 2005, ON.KG wrote:

> Hi!
>
> Could I use "use", "require" functions in plperl?
>
> for example,
>
> CREATE OR REPLACE FUNCTION perl_func (text)
> RETURNS real
> AS '
> use HTTP::Request;
> use HTTP::Headers;
> ....
> return $value;
> '
> LANGUAGE 'plperl';
>
>
> with me it doesn't work and returns error message
> "Query failed: ERROR: creation of function failed: 'require' trapped by
> operation mask at (eval 2) line 2. in ..."
>
> Thanx
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: the planner will ignore your desire to choose an index scan if your
> joining column's datatypes do not match
>


From: "ON(dot)KG" <skyer(at)on(dot)kg>
To: pgsql-general(at)postgresql(dot)org
Subject: PL/Perl
Date: 2005-01-07 18:17:36
Message-ID: 8122979390.20050107211736@on.kg
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Hi!

Could I use "use", "require" functions in plperl?

for example,

CREATE OR REPLACE FUNCTION perl_func (text)
RETURNS real
AS '
use HTTP::Request;
use HTTP::Headers;
....
return $value;
'
LANGUAGE 'plperl';

with me it doesn't work and returns error message
"Query failed: ERROR: creation of function failed: 'require' trapped by
operation mask at (eval 2) line 2. in ..."

Thanx


From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: "ON(dot)KG" <skyer(at)on(dot)kg>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: PL/Perl
Date: 2005-01-07 18:21:00
Message-ID: 41DED30C.4090604@commandprompt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general


>
> with me it doesn't work and returns error message
> "Query failed: ERROR: creation of function failed: 'require' trapped by
> operation mask at (eval 2) line 2. in ..."

You need to use plperlu.

Sincerely,

Joshua D. Drake

>
> Thanx
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: the planner will ignore your desire to choose an index scan if your
> joining column's datatypes do not match

--
Command Prompt, Inc., home of PostgreSQL Replication, and plPHP.
Postgresql support, programming shared hosting and dedicated hosting.
+1-503-667-4564 - jd(at)commandprompt(dot)com - http://www.commandprompt.com
Mammoth PostgreSQL Replicator. Integrated Replication for PostgreSQL

Attachment Content-Type Size
jd.vcf text/x-vcard 640 bytes

From: Kris Jurka <books(at)ejurka(dot)com>
To: Brian Maguire <bmaguire(at)vantage(dot)com>
Cc: pgsql-general(at)postgresql(dot)org, Kevin MacClay <kmacclay(at)vantage(dot)com>
Subject: Re: J2SE 1.5 Cache Rowset(JSR 114 )
Date: 2005-01-08 18:26:55
Message-ID: Pine.BSO.4.56.0501081325470.20796@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On Fri, 7 Jan 2005, Brian Maguire wrote:

> Just as an FYI. Sun's Cache rowset which is new and part of the J2SE
> 1.5 is not compatable with Postgres. We have been working with Sun's
> JAVA development team to resolve the issues through our test cases and
> debugging. We hope that in a future patch update that the issues will
> be resolved. We'll keep you up to date.
>

Any more details on the problem? A link to Sun's bug database? If you
suspect the postgresql jdbc driver I'd be happy to take a look at a
testcase.

Kris Jurka


From: Ragnar Hafstað <gnari(at)simnet(dot)is>
To: "ON(dot)KG" <skyer(at)on(dot)kg>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: PL/Perl
Date: 2005-01-11 10:54:44
Message-ID: 1105440885.11499.74.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On Tue, 2005-01-11 at 14:59 +0300, ON.KG wrote:

> I'm trying in 'plperl' forking the processes by 'fork' function,
> but receiving this message
>
> Warning: pg_exec(): Query failed: ERROR: creation of function failed: 'fork' trapped by operation mask at (eval 2) line 11.
>
> Does it mean, that in 'plperl' I can't use 'fork' function???

there are 2 variants of the language: plperl and plperlu

plperlu is 'untrusted', that is, it is allowed to do dangerous stuff,
but plperl is more limited and can be used by a user without privileges.

OTOH, i doubt that fork is allowed even in plperlu, as i
imagine it could have weird effects on the backend.

gnari


From: Richard Huxton <dev(at)archonet(dot)com>
To: "ON(dot)KG" <skyer(at)on(dot)kg>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: PL/Perl
Date: 2005-01-11 10:55:16
Message-ID: 41E3B094.30107@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

ON.KG wrote:
> Hi All!
>
> I'm trying in 'plperl' forking the processes by 'fork' function, but
> receiving this message
>
> Warning: pg_exec(): Query failed: ERROR: creation of function failed:
> 'fork' trapped by operation mask at (eval 2) line 11.
>
> Does it mean, that in 'plperl' I can't use 'fork' function???

Think about it - you're trying to fork an active database backend.
Personally, I'd decouple things and fetch webpages/files from outside
the database anyway.

You might find the documentation on NOTIFY/LISTEN useful.

--
Richard Huxton
Archonet Ltd


From: "ON(dot)KG" <skyer(at)on(dot)kg>
To: pgsql-general(at)postgresql(dot)org
Subject: PL/Perl
Date: 2005-01-11 11:59:55
Message-ID: 1906385406.20050111145955@on.kg
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Hi All!

I'm trying in 'plperl' forking the processes by 'fork' function,
but receiving this message

Warning: pg_exec(): Query failed: ERROR: creation of function failed: 'fork' trapped by operation mask at (eval 2) line 11.

Does it mean, that in 'plperl' I can't use 'fork' function???

function example
=================
CREATE OR REPLACE FUNCTION perl_fork_test ()
RETURNS int2
AS '
my %pid;

my @urls = (
"http://domain1.com/index.php",
"http://domain2.com/index.php"
);

foreach my $url (@urls) {
unless ($pid{$url} = fork) {
my $html = qx/GET "$url"/;

$ENV{TERM} = &my_exit;

sub my_exit {
exit(0);
}
}
}

sleep 6;
foreach my $url (keys %pid) {
kill SIGTERM, $pid{$url};
}

wait;

return 1;
'
LANGUAGE 'plperl';
===================
VOLATILE
CALLED ON NULL INPUT
SECURITY INVOKER
===================

Thanx


From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: "ON(dot)KG" <skyer(at)on(dot)kg>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: PL/Perl
Date: 2005-01-11 16:04:43
Message-ID: 41E3F91B.4010306@commandprompt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

ON.KG wrote:

>Hi All!
>
>I'm trying in 'plperl' forking the processes by 'fork' function,
>but receiving this message
>
>

Have you tried performing this with plperlU?

Sincerely,

Joshua D. Drake

>Warning: pg_exec(): Query failed: ERROR: creation of function failed: 'fork' trapped by operation mask at (eval 2) line 11.
>
>Does it mean, that in 'plperl' I can't use 'fork' function???
>
>function example
>=================
>CREATE OR REPLACE FUNCTION perl_fork_test ()
>RETURNS int2
>AS '
>my %pid;
>
>my @urls = (
> "http://domain1.com/index.php",
> "http://domain2.com/index.php"
>);
>
>foreach my $url (@urls) {
> unless ($pid{$url} = fork) {
> my $html = qx/GET "$url"/;
>
> $ENV{TERM} = &my_exit;
>
> sub my_exit {
> exit(0);
> }
> }
>}
>
>sleep 6;
>foreach my $url (keys %pid) {
> kill SIGTERM, $pid{$url};
>}
>
>wait;
>
>return 1;
>'
>LANGUAGE 'plperl';
>===================
>VOLATILE
>CALLED ON NULL INPUT
>SECURITY INVOKER
>===================
>
>Thanx
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 7: don't forget to increase your free space map settings
>
>

--
Command Prompt, Inc., home of Mammoth PostgreSQL - S/ODBC and S/JDBC
Postgresql support, programming shared hosting and dedicated hosting.
+1-503-667-4564 - jd(at)commandprompt(dot)com - http://www.commandprompt.com
PostgreSQL Replicator -- production quality replication for PostgreSQL

Attachment Content-Type Size
jd.vcf text/x-vcard 285 bytes