Sanitize schema name - Mailing list psycopg

From Ludovic Gasc
Subject Sanitize schema name
Date
Msg-id CAON-fpF0Axc5XS7VPhzQNgsVsmTbkSuCxs5HT8+Ug9g8xCUsAw@mail.gmail.com
Whole thread Raw
Responses Re: Sanitize schema name
List psycopg
Hi,

I want to sanitize the name of the schema in a SQL query, because the schema name depends on the client.

The issue is that I can't sanitize the name via the standard way of psycopg2, because it adds quotes around schema name.

I imagine it's the same issue with a table name. Do you have a suggestion to bypass that ?

For now, the most secure way I've found is to test the presence of the schema before launch each query, but not really efficient.

Regards.
--
Ludovic Gasc (GMLudo)

psycopg by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Possible reasons for copy_from to never terminate?
Next
From: Adrian Klaver
Date:
Subject: Re: Sanitize schema name