Hello:
As you know the interface of PQexec():
PGresult *PQexec(PGconn *conn, const char *command);
"command" contains some SQL statements.
But there exist "\0" in some data filed, and I found PQexec() failed
on such situation.
Something like this:
PQexec(conn, "INSERT INTO ('t', 'abc\0
On Thu, Nov 08, 2007 at 06:39:23PM -0800, jason wrote:
> As you know the interface of PQexec():
> PGresult *PQexec(PGconn *conn, const char *command);
>
> "command" contains some SQL statements.
>
> But there exist "\0" in some data filed, and I found PQexec() failed
> on such situation.
Two wa
On Nov 12, 2007 11:13 PM, Martijn van Oosterhout <[EMAIL PROTECTED]> wrote:
> On Thu, Nov 08, 2007 at 06:39:23PM -0800, jason wrote:
> > As you know the interface of PQexec():
> > PGresult *PQexec(PGconn *conn, const char *command);
> >
> > "command" contains some SQL statements.
> >
> > But there
On Tue, Nov 13, 2007 at 10:52:09AM +0800, yang zhenyu wrote:
> > > But there exist "\0" in some data filed, and I found PQexec() failed
> > > on such situation.
>
> Thanks for reply :-)
> But would you please give me more details or some references?
>
> > Two ways:
> > - out of line parameters
>
> > > - out of line parameters
> > How to? Is there any function for this? I mean the C interface.
>
> PQexecParams.
>
> > > - escape the nulls, like \0
> > Do you mean this function?
> > #unsigned char *PQescapeBytea(const unsigned char *from,
> > # size_t from_length,