Search Postgresql Archives

Re: psycopg2.DataError: invalid input syntax for integer: ""

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, May 7, 2018 at 6:35 AM, Adrian Klaver <adrian.klaver@xxxxxxxxxxx> wrote:

            Not sure but I'm thinking you at least need to add single
            quotes around the %s symbols.  That doesn't really explain
            the integer input error though I'm not familiar with the
            exact features of the execute method in Python.

They do not need to be quoted:

http://initd.org/psycopg/docs/usage.html#passing-parameters-to-sql-queries

​Yeah, upon further reflection overnight I figured it must incorporate sql-injection prevention.  The use of "%s", which is typically a printf construct and printf doesn't do that kind of thing, threw me.

David J.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux