Search This Blog

Saturday, April 2, 2011

Python PostgresSQL and puntuaction

I am experimenting some Database processing and as a simple test I want to query all the entries of a database that contains a given text.

What if the text contains quotes ?
Using psycopg2 the solution si to use adapt

Reading Stackoverflow answer and testing them myself the solution is to use the adapt function

from psycopg2.extensions import adapt

No comments: