PQexec(), what should I do for the "NULL in command" problem? - Mailing list pgsql-general

From jason
Subject PQexec(), what should I do for the "NULL in command" problem?
Date
Msg-id 1194575963.723752.5830@v29g2000prd.googlegroups.com
Whole thread Raw
Responses Re: PQexec(), what should I do for the "NULL in command" problem?  (Martijn van Oosterhout <kleptog@svana.org>)
List pgsql-general
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 tttt('ttttt', 'abc\0abc');


Does anyone know something about this?
How can I insert a record which has some NULLs in data filed?


Best Regards,
Jason


pgsql-general by date:

Previous
From: Gordon
Date:
Subject: Duplicating a table row while honouring key constraints
Next
From: Mark Niedzielski
Date:
Subject: Linux v.s. Mac OS-X Performance