Backslash and quotes in ecpg, libpq - Mailing list pgsql-interfaces

From Margarita Barvinok
Subject Backslash and quotes in ecpg, libpq
Date
Msg-id 3991930D.D01B966@umich.edu
Whole thread Raw
List pgsql-interfaces
Hi,

I use postgresql-7.0, ecpg, libpq.
I need to insert text with single quotes from C-program into database.
As I understand, I have to use backslash in this case: aaa\'aaa';
This works when I insert data from psql by \i <file>, or by INSERT
command, or by COPY.
But C-program gives an error: sql error Too many arguments.
By the way, when the text contain just one backslash (aaa\aaa), the
program inserts exactly this data: aaa\aaa.
I think it means that backslash doesn't work as escape character.

Please help,
-Rita
--
---------------------------------------------------------
Margarita Barvinok               University of Michigan
System Administrator II          Department of Biology
---------------------------------------------------------




pgsql-interfaces by date:

Previous
From: "Simon Hardingham"
Date:
Subject: RE: ODBC driver for Windows
Next
From: Rolf Lüttecke
Date:
Subject: Backend-Crash