postgresql - Does psycopg2's "execute()" offer sufficient SQL injection prevention? -


can sleep easy knowing no sql injection can past pycopg2?

of course assuming correctly use it. understand have use parameterisation (sp?) feature of cursor.execute() function, eg

my_cur.execute(insert_statement, value_list) 

and not like

my_cur.execute(insert_statement % value_list) 

the question whether there value in me parsing , adding escapes strings in value_list.

the question whether there value in me parsing , adding escapes strings in value_list.

no, should not need that. entire point of two-argument form avoid having escape strings. if escape them manually, psycopg2 escape them again, escaped form visible end users. not intend.


Comments

Popular posts from this blog

cakephp - simple blog with croogo -

How to group boxplot outliers in gnuplot -

bash - Performing variable substitution in a string -