Re: [GENERAL] Insert and Retrieve unsigned char sequences using C

2010-07-22 Thread Merlin Moncure
2010/7/22 Vinícius Soares : > Hey, > > thanks for your response. > I did it: > >     S8 sql[1500] = "insert into t values ( E'"; >         U8 *msg; >     msg = PQescapeByteaConn(conn, pending_cmd->cmd.value, > sizeof(msg_cmd_t), &to_length); >     for (i=0; i < sizeof(msg_cmd_t); i++){

Re: [GENERAL] Insert and Retrieve unsigned char sequences using C

2010-07-21 Thread Merlin Moncure
On Mon, Jul 19, 2010 at 8:14 PM, vinicius_bra wrote: > > Hi All, > > I'm developing a system in C and I have a unsigned char pointer that > represents a struct and I like to store it in a bytea column in postgreSQL. > How can I do it? > Example: you have several options: *) encode the memory for

Re: [GENERAL] Insert and Retrieve unsigned char sequences using C

2010-07-19 Thread Lew
vinicius_bra wrote: I'm developing a system in C and I have a unsigned char pointer that represents a struct and I like to store it in a bytea column in postgreSQL. The pointer does not represent the struct. How can I do it? Example: str_t temp; unsigned char *ptr; ptr = (unsigned char *)&te