PQexec(), what should I do for the "NULL in command" problem?

From: jason <zhyuyang(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: PQexec(), what should I do for the "NULL in command" problem?
Date: 2007-11-09 02:39:23
Message-ID: 1194575963.723752.5830@v29g2000prd.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2007-11-09 03:36:37 Re: (Never?) Kill Postmaster?
Previous Message smiley2211 2007-11-09 01:45:51 Re: pg_ctl & show all