Skip to content

Commit 24fa874

Browse files
committed
Fix incorrect wording about function failure time on unsafe ops - these are now caught by the validator. And a small visit from the perl style police: check the return value from open().
1 parent 8191597 commit 24fa874

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

doc/src/sgml/plperl.sgml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$PostgreSQL: pgsql/doc/src/sgml/plperl.sgml,v 2.47 2005/10/18 22:53:54 adunstan Exp $
2+
$PostgreSQL: pgsql/doc/src/sgml/plperl.sgml,v 2.48 2005/10/24 15:39:50 adunstan Exp $
33
-->
44

55
<chapter id="plperl">
@@ -554,12 +554,16 @@ $$ LANGUAGE plperl;
554554
system operations are not allowed for security reasons:
555555
<programlisting>
556556
CREATE FUNCTION badfunc() RETURNS integer AS $$
557-
open(TEMP, "&gt;/tmp/badfile");
558-
print TEMP "Gotcha!\n";
557+
my $tmpfile = "/tmp/badfile";
558+
open my $fh, '&gt;', $tmpfile
559+
or elog(ERROR, qq{Could not open the file "$tmpfile": $!});
560+
print $fh "Testing writing to a file\n";
561+
close $fh or elog(ERROR, qq{Could not close the file "$tmpfile": $!});
559562
return 1;
560563
$$ LANGUAGE plperl;
561564
</programlisting>
562-
The creation of the function will succeed, but executing it will not.
565+
The creation of this function will fail as its use of a forbidden
566+
operation will be be caught by the validator.
563567
</para>
564568

565569
<para>

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy