deveel/deveeldb

Optional Specification of Columns with Default Value in INSERT statements

Closed this issue · 1 comments

The current implementation of the INSERT statements (INSERT INTO ... and INSERT INTO ... FROM ...) require all columns of the table where to insert to be specified, and it results into an exception if this is not done.
Some columns have DEFAULT values to be applied if the values are not explicitly specified, but this is ignored by the statements.

Actually this condition is required only for the INSERT INTO ... FROM ... (or Insert-Select) statement, and it has a precise logic: not always it is possible to determine the source columns (if the alias is not specified), so the number of columns selected must be equal to the columns in the destination table and the sequence must respect the structure.