Re: Another small pl/perl patch

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Greg Sabino Mullane <greg(at)turnstep(dot)com>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Another small pl/perl patch
Date: 2005-10-24 15:22:00
Message-ID: 435CFC18.5070503@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Greg Sabino Mullane wrote:

>-----BEGIN PGP SIGNED MESSAGE-----
>Hash: SHA1
>
>
>
>
>>Well, I personally almost always use indirect file handles rather than
>>globals. But I don't know that using globals file handles (which is what
>>I gather you are objecting to) is deprecated, is it? The perl docs are
>>absolutely littered with examples.
>>
>>
>
>No, my primary objection was using open() without checking the result.
>Everything else was icing. :)
>
>

I see. Well, given that it is meant to illustrate something that won't
run, I don't think that matters too much. But there is another error on
that page, where we state that the function will be created but fail to
run. In fact, now that we have a validator, it will not even be created:

andrew=# CREATE FUNCTION badfunc() RETURNS integer AS $$
andrew$# open(TEMP, ">/tmp/badfile");
andrew$# print TEMP "Gotcha!\n";
andrew$# return 1;
andrew$# $$ LANGUAGE plperl;
ERROR: creation of Perl function failed: 'open' trapped by operation
mask at line 2.
andrew=#

I'll make your change and fix the incorrect wording shortly.

cheers

andrew

In response to

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2005-10-24 15:38:17 Re: Will PQregisterThreadLock() be documented?
Previous Message Greg Sabino Mullane 2005-10-24 15:06:48 Re: Another small pl/perl patch