Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit24fa874

Browse files
committed
Fix incorrect wording about function failure time on unsafe ops - theseare now caught by the validator. And a small visit from the perl style police:check the return value from open().
1 parent8191597 commit24fa874

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)

[8]ページ先頭

©2009-2025 Movatter.jp