Search Postgresql Archives

Re: Bytea question with \208

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Decibel! wrote:
On Thu, Aug 09, 2007 at 04:16:15PM -0400, Woody Woodring wrote:
My bad,  the table I was looking (8.7) at had the first column as the
decimal representation and I did notice that the numbers changed as they
moved right.

Is there a way for bytea to take a hex number, or do I need to convert the
bit stream to octal numbers?

to_hex()?

to_hex() produces the text representation of the hex digits, not the actual bytes with those values.

What the OP wants is to conveniently represent the bytestream to send to the bytea column. They're looking for an escape sequence to embed into a text representation that will map to the exact byte contents to insert, not a text representation of that representation.

Say,
Also supported are \digits, where digits represents an octal byte value, and \xhexdigits, where hexdigits represents a hexadecimal byte value. (It is your responsibility that the byte sequences you create are valid characters in the server character set encoding.)
<http://www.postgresql.org/docs/8.2/static/sql-syntax-lexical.html#SQL-SYNTAX-STRINGS>

Amazing how useful the docs are.

--
Lew

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to majordomo@xxxxxxxxxxxxxx so that your
      message can get through to the mailing list cleanly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux