How to quote text before inserting into database?

Поиск
Список
Период
Сортировка
От Scott Chapman
Тема How to quote text before inserting into database?
Дата
Msg-id 200310172129.40718.scott_list@mischko.com
обсуждение исходный текст
Ответы Re: How to quote text before inserting into database?
Список pgsql-general
I am working with Python (psycopg).  I have HTML with embedded Python that I'm
inserting into a database and it could contain any character.

Single quotes, at least, must be escaped (to two single quotes, right?) before
inserting it into Postgres.

This poses a problem when I get the data out of the table.  It could have
originally contained two single quotes together and I replace them with one
single quote in the unescaping process.

How do you properly escape the special characters (and what all are they)?

TIA,
Scott

В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Using subselects in INSERTs?
Следующее
От: Greg Stark
Дата:
Сообщение: Re: VACUUM degrades performance significantly. Database