oh, you're using insert.values() with multivalues. Sure, use a literal_column()
for that, this is not a normal SQL thing. it won't scale to huge numbers
because you will overflow the query buffer, unless you break them into batches.
I might prefer to use the psycopg2 batch mode helpers instead
As you may have guessed the DEFAULT keyword is used to "even" the size of
the tuples in the VALUES clause and explicitly asks the RDBMS to replace
itself with the currently defined default value for the corresponding
column.
The RDBMS in question is Postgres (>=11).
The context is we want to
On Tue, Apr 14, 2020, at 10:41 AM, Nicolas Caniart wrote:
> Hi !
>
> I've been looking into the documentation but could not find it.
> What is the proper way to insert a DEFAULT keywork in the tuples of the
> VALUES clause in an INSERT statement ? As in
>
> CREATE TABLE number (
> i INTEGER,
Hi !
I've been looking into the documentation but could not find it.
What is the proper way to insert a DEFAULT keywork in the tuples of the
VALUES clause in an INSERT statement ? As in
CREATE TABLE number (
i INTEGER,
letters STRING,
roman STRING DEFAULT '',
) ;
INSERT INTO number