Thread: Binary data in bytea field
I have a table with field of tyte bytea. I'm reading this table with C, libpq. The result is a string, with octal groups, like '\200'. Is it possible to get data as it is, every byte in one byte? Thanks
Iklódi Lajos wrote: > I have a table with field of tyte bytea. I'm reading this table with C, > libpq. > The result is a string, with octal groups, like '\200'. > Is it possible to get data as it is, every byte in one byte? > Thanks > Sure -- just use a binary cursor. HTH, Joe
> Iklódi Lajos wrote: > > I have a table with field of tyte bytea. I'm reading this table with C, > > libpq. > > The result is a string, with octal groups, like '\200'. > > Is it possible to get data as it is, every byte in one byte? > > Thanks > > > > Sure -- just use a binary cursor. > > HTH, > > Joe Thanks, really it is in docs. How can I make binary updates? Lajos
Iklódi Lajos wrote: >>Iklódi Lajos wrote: >> >>>I have a table with field of tyte bytea. I'm reading this table with C, >>>libpq. >>>The result is a string, with octal groups, like '\200'. >>>Is it possible to get data as it is, every byte in one byte? >>>Thanks >>> >> >>Sure -- just use a binary cursor. >> >>HTH, >> >>Joe > > > Thanks, really it is in docs. > How can I make binary updates? > > Lajos > See: http://www.us.postgresql.org/users-lounge/docs/7.2/postgres/libpq-exec.html section 1.3.3 "Escaping binary strings for inclusion in SQL queries". Joe