On Thu, 4 Mar 2021, 06:43 Hans Ginzel, wrote:
> On Wed, Mar 03, 2021 at 03:23:28PM -0800, Adrian Klaver wrote:
> >On 3/3/21 1:51 PM, Hans Ginzel wrote:
> >You need to do something like:
> >cur.execute(sql.SQL("INSERT INTO test_default VALUES
> ({})").format(DEFAULT))
>
> Formating values into SQL
On Wed, Mar 03, 2021 at 03:23:28PM -0800, Adrian Klaver wrote:
On 3/3/21 1:51 PM, Hans Ginzel wrote:
You need to do something like:
cur.execute(sql.SQL("INSERT INTO test_default VALUES ({})").format(DEFAULT))
Formating values into SQL statement is done by the execute(), isn't it?
I like the so
On 3/3/21 1:51 PM, Hans Ginzel wrote:
How to insert DEFAULT value, please?
import psycopg2
from psycopg2.sql import DEFAULT #
https://www.postgresql-archive.org/Inserting-default-values-into-execute-values-td6130148.html
db = psycopg2.connect(host='host', dbname='db'
How to insert DEFAULT value, please?
import psycopg2
from psycopg2.sql import DEFAULT#
https://www.postgresql-archive.org/Inserting-default-values-into-execute-values-td6130148.html
db = psycopg2.connect(host='host', dbname='db')
cursor = db.cursor()
cursor.ex