PostgresDAC

TPSQLTable.Properties.ByteaAsEscString

Previous Next

Indicates whether an BYTEA native Postgres field type will be treated as escaped sequence of characters (varchar) or like Delphi BLOB field.

Syntax:

property ByteaAsEscString: Boolean;

Description:

Set the value of ByteaAsEscString to True to enable BYTEA fields type casting to escaped string.

BYTEA octets are escaped in the output in such way. In general, each "non-printable" octet is converted into its equivalent three-digit octal value and preceded by one backslash. Most "printable" octets are represented by their standard representation in the client character set. The octet with decimal value 92 (backslash) has a special alternative output representation. See details in the table below.

Decimal Octet ValueDescriptionEscaped Output RepresentationExampleOutput Result
92backslash\\SELECT '\\134'::bytea;\\
0 to 31 and 127 to 255"non-printable" octets\xxx (octal value)SELECT '\\001'::bytea;\001
32 to 126"printable" octetsclient character set representationSELECT '\\176'::bytea;~