Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
bulk_insert produces invalid SQL if rows is empty #168
Migrated issue, originally created by Michael Howitz (@icemac)
If rows is empty
Michael Bayer (@zzzeek) wrote:
that SQL isn't broken btw, that is exactly how to render an INSERT with no parameters:
your code example above isn't clear in that you suggest there's a stack trace but you aren't illustrating what the error message is.
Sending an empty collection to bulk_insert() IMO should just raise an error, it is ambiguous what one's intent would be in sending such a list. I don't know that I'm comfortable with an op.XYZ() directive deciding not to emit any SQL based on parameters.
Michael Howitz (@icemac) wrote:
Sorry for being not complete. My use case is a bit more complex than described.
The actual error message is:
The empty list shown for insert is actually the result of a select on users. It might return no results. I'd prefer