php-doc-en/reference/pgsql/functions/pg-unescape-bytea.xml

63 lines
2 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.1 $ -->
<!-- splitted from ./en/functions/pgsql.xml, last change in rev 1.61 -->
<refentry id='function.pg-unescape-bytea'>
<refnamediv>
<refname>pg_unescape_bytea</refname>
<refpurpose>
Escape binary for bytea type
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>string</type><methodname>pg_unescape_bytea</methodname>
<methodparam><type>string</type><parameter>data</parameter></methodparam>
</methodsynopsis>
<para>
<function>pg_unescape_bytea</function> unescapes string from
bytea datatype. It returns unescaped string (binary).
</para>
<note>
<para>
When you SELECT bytea type, PostgreSQL returns octal byte value
prefixed by \ (e.g. \032). Users are supposed to convert back to
binary format by yourself.
</para>
<para>
This function requires PostgreSQL 7.2 or later. With PostgreSQL
7.2.0 and 7.2.1, bytea type must be casted when you enable
multi-byte support. i.e. <literal>INSERT INTO test_table (image)
VALUES ('$image_escaped'::bytea);</literal> PostgreSQL 7.2.2 or
later does not need cast. Exception is when client and backend
character encoding does not match, there may be multi-byte
stream error. User must cast to bytea to avoid this error.
</para>
</note>
<para>
See also <function>pg_escape_bytea</function> and
<function>pg_escape_string</function>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->