Re: [PATCHES] plperl strict mode and associated fixes

2005-08-23 Thread Tom Lane
Michael Fuhr <[EMAIL PROTECTED]> writes: > Hmmm...even if the "plperl" custom variable class isn't defined in > postgresql.conf, plperl.use_strict springs into existence when the > interpreter is initialized: Yes, this is per spec. The "custom class" concept is only intended to allow you to put t

Re: [PATCHES] plperl strict mode and associated fixes

2005-08-23 Thread Michael Fuhr
On Tue, Aug 23, 2005 at 09:12:10PM -0400, Andrew Dunstan wrote: > The attached patch completes (I hope) the work begun by Michael Fuhr in > an earlier unapplied patch, and makes strict mode work as recently > discussed. I moved the embedded strings out of the calling functions > into global macr

[PATCHES] plperl strict mode and associated fixes

2005-08-23 Thread Andrew Dunstan
The attached patch completes (I hope) the work begun by Michael Fuhr in an earlier unapplied patch, and makes strict mode work as recently discussed. I moved the embedded strings out of the calling functions into global macros to try to make the code a little more readable. Unfortunately we

Re: [PATCHES] plperl strict mode

2005-05-24 Thread Andrew Dunstan
Alvaro Herrera wrote: Yes, you can register a function as "validator" during language creation. AFAIR there are no validator functions except SQL and plpgsql, so you would have to create one for plperl ... Excellent. We'll definitely work on that. Not having this has annoyed me (and I'

Re: [PATCHES] plperl strict mode

2005-05-24 Thread Alvaro Herrera
On Tue, May 24, 2005 at 11:53:45AM -0400, Andrew Dunstan wrote: > Alvaro Herrera wrote: > > >On Sat, May 21, 2005 at 04:04:36PM -0400, Andrew Dunstan wrote: > > > >Hmm, is there a way to have a validator function and have the strict > >check at function creation too? I know these things are repo

Re: [PATCHES] plperl strict mode

2005-05-24 Thread Andrew Dunstan
Alvaro Herrera wrote: On Sat, May 21, 2005 at 04:04:36PM -0400, Andrew Dunstan wrote: Andrew, it works like this: andrew=# create or replace function foo() returns text language plperl as $$ $x = 1; return 'hello'; $$; CREATE FUNCTION andrew=# select foo(); ERROR: creation of Perl fu

Re: [PATCHES] plperl strict mode

2005-05-24 Thread Alvaro Herrera
On Sat, May 21, 2005 at 04:04:36PM -0400, Andrew Dunstan wrote: Andrew, > it works like this: > > andrew=# create or replace function foo() returns text language plperl > as $$ $x = 1; return 'hello'; $$; > CREATE FUNCTION > andrew=# select foo(); > ERROR: creation of Perl function failed: Glo

[PATCHES] plperl strict mode

2005-05-21 Thread Andrew Dunstan
The attached patch (submitted for testing and comment) allows turning on perl strict mode via a GUC setting for plperl/plperlu. (plplerlu users would be able to turn it off again, but plperl users would not, I think. Certainly not straightforwardly at least. In order to protect legacy code,