projects
/
users
/
simon
/
postgres.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
93284b7
)
Fix example of de-escaping bytea argument, per Florian Weimer. Also fix example
author
Andrew Dunstan
<andrew@dunslane.net>
Fri, 25 Jan 2008 15:28:35 +0000
(15:28 +0000)
committer
Andrew Dunstan
<andrew@dunslane.net>
Fri, 25 Jan 2008 15:28:35 +0000
(15:28 +0000)
of escaping bytea return value. Both cases did not handle backslash values properly.
doc/src/sgml/plperl.sgml
patch
|
blob
|
blame
|
history
diff --git
a/doc/src/sgml/plperl.sgml
b/doc/src/sgml/plperl.sgml
index 6c1092350eb2717554f473b9680e51db8cefe26f..efeef8060138af7ce03e1393d9be57f6636bb403 100644
(file)
--- a/
doc/src/sgml/plperl.sgml
+++ b/
doc/src/sgml/plperl.sgml
@@
-150,7
+150,7
@@
$$ LANGUAGE plperl;
<programlisting>
my $arg = shift;
- $arg =~ s!\\(
\d{3})!chr(oct($1))
!ge;
+ $arg =~ s!\\(
?:\\|(\d{3}))!$1 ? chr(oct($1)) : "\\"
!ge;
</programlisting>
</para>
@@
-161,7
+161,7
@@
$$ LANGUAGE plperl;
is how to escape binary data for a return value of type <type>bytea</>:
<programlisting>
- $retval =~ s!([^ -~])!sprintf("\\%03o",ord($1))!ge;
+ $retval =~ s!(
\\|
[^ -~])!sprintf("\\%03o",ord($1))!ge;
return $retval;
</programlisting>