Re: Sanitize schema name - Mailing list psycopg

From Dorian Hoxha
Subject Re: Sanitize schema name
Date
Msg-id CANsFX06SaSxg--2MMaodAtQJvf+6wMuyAJ-aXOYU08QCmpggpw@mail.gmail.com
Whole thread Raw
In response to Re: Sanitize schema name  (Daniele Varrazzo <daniele.varrazzo@gmail.com>)
List psycopg
Since it will be an optional separate function, and won't interfere with old code, I don't see a problem with it being in 2.6.1

On Thu, May 7, 2015 at 2:01 PM, Daniele Varrazzo <daniele.varrazzo@gmail.com> wrote:
On Thu, May 7, 2015 at 12:35 PM, Dorian Hoxha <dorian.hoxha@gmail.com> wrote:
> He wants to dynamically pass the table name:
>
> cursor.execute("SELECT * FROM %s", (table,)) # won't work

Looks like there is more and more the need of exposing a function like
libpq's PQescapeIdentifier [1]. Too bad psycopg 2.6 has been released
so recently, I'm reluctant to add such a function to 2.6.1.

Maybe releasing a small Python module exposing just that function,
then add the functionality to psycopg 2.7?

[1] http://www.postgresql.org/docs/9.4/static/libpq-exec.html#LIBPQ-PQESCAPEIDENTIFIER

-- Daniele

psycopg by date:

Previous
From: Daniele Varrazzo
Date:
Subject: Re: Sanitize schema name
Next
From: Karsten Hilbert
Date:
Subject: Re: Sanitize schema name