Re: [psycopg] Solving the SQL composition problem - Mailing list psycopg

From Jim Nasby
Subject Re: [psycopg] Solving the SQL composition problem
Date
Msg-id 86ed1046-7895-a758-f8f2-7dbab82de569@BlueTreble.com
Whole thread Raw
In response to [psycopg] Solving the SQL composition problem  (Daniele Varrazzo <daniele.varrazzo@gmail.com>)
Responses Re: [psycopg] Solving the SQL composition problem  (Adrian Klaver <adrian.klaver@aklaver.com>)
Re: [psycopg] Solving the SQL composition problem  (Daniele Varrazzo <daniele.varrazzo@gmail.com>)
List psycopg
On 1/1/17 2:11 AM, Daniele Varrazzo wrote:
>         sql.SQL("insert into %s values (%%s)") % [sql.Identifier('mytable')],

Since %s isn't standard parameter replacement anyway, I'm wondering if
both considerations could just be handled by execute(), by using
different replacement syntax. IE:

execute('insert into %s values ($1)', [42], ['my table'])

Obviously this would be backwards incompatible, but I think that's
manageable.
--
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com
855-TREBLE2 (855-873-2532)


psycopg by date:

Previous
From: Daniele Varrazzo
Date:
Subject: Re: [psycopg] speed concerns with executemany()
Next
From: Adrian Klaver
Date:
Subject: Re: [psycopg] Solving the SQL composition problem