Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: convert int to bytea





Usama Dar wrote:



2) i know what a byte order is , i just thought your interface i.e. libpq would convert it to the local byte order.


You haven't thought this through. Data traveling over libpq is still text, not binary, in most cases, so byte order is irrelevant at that time. The translation to a bytea (if possible) would be done after the data was already on the server and the int was in its native, architecture dependent form.

The short answer is thus still that there is no sane consistent cast from int to bytea.

If you want a bytea then it's really up to you to contruct the byte array.

cheers

andrew



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group