Re: Sanitize schema name

From: Karsten Hilbert <Karsten(dot)Hilbert(at)gmx(dot)net>
To: psycopg(at)postgresql(dot)org
Subject: Re: Sanitize schema name
Date: 2015-05-07 12:28:37
Message-ID: 20150507122837.GD2630@hermes.hilbert.loc
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: psycopg

On Thu, May 07, 2015 at 01:01:48PM +0100, Daniele Varrazzo 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.

Making it available for explicit use wouldn't hurt, would it ?

Karsten
--
GPG key ID E4071346 @ eu.pool.sks-keyservers.net
E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346

In response to

Browse psycopg by date

  From Date Subject
Next Message Adrian Klaver 2015-05-07 13:33:29 Re: Sanitize schema name
Previous Message Dorian Hoxha 2015-05-07 12:25:06 Re: Sanitize schema name