Обсуждение: Backslash and quotes in ecpg, libpq

Поиск
Список
Период
Сортировка

Backslash and quotes in ecpg, libpq

От
Margarita Barvinok
Дата:
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
---------------------------------------------------------