-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fails value insertion if type unsupported by duckdb #471
base: main
Are you sure you want to change the base?
Conversation
f245d2d
to
76681ba
Compare
Thank you for the contribution. The fact that we silently fall back to double has been bothering me too (see #309). I think it would be nice to make this a configurable setting that should probably be off by default, called something like However, afaict in the case you're describing this is actually not what is happening. In this case
|
To be clear, I think it's probably reasonable to disallow specifying plain |
Both suggestion makes sense to me, thank you! I will make changes these days. |
f08e29f
to
0e97387
Compare
Hi @JelteF , I tried to implemented your suggestion, which fails to create table if column type is not supported by duckdb. |
@@ -253,6 +292,10 @@ DECLARE_PG_FUNCTION(duckdb_create_table_trigger) { | |||
elog(ERROR, "Expected single table to be created, but found %" PRIu64, static_cast<uint64_t>(SPI_processed)); | |||
} | |||
|
|||
// Check whether new table creation is supported in duckdb. | |||
// TODO(hjiang): Same type validation should be applied to other DDL as well. | |||
ValidateRelationCreation(SPI_tuptable->tupdesc); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: prob move this check to pgduckdb_get_tabledef()
, where other lockdowns (e.g., generated columns, identity columns) are handled
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it makes sense, my concern is, other DDL statements (i.e. ALTER TABLE) require the same validation logic.
I would prefer to put the validation logic in the same file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where other lockdowns (e.g., generated columns, identity columns) are handled
I fully agree to place all validation logic into one function / one place.
My personal preference is to move all logic into DDL file, since other validations (i.e. generated columns, as you mentioned) should also apply to other DDL statements.
Would like to know how pg_duckdb's owner think about it. :)
50e9d3a
to
331bd4e
Compare
Hi @JelteF , I'm wondering if you could take another look when you have some time? Thank you!
On this proposal, I will address it in another followup PR. |
There's branch conflict and unit test failure, let me resolve them before re-requesting reviews. |
331bd4e
to
d29be83
Compare
I would like to followup on issue: #467
I think current implementation is not ideal:
Here I propose two improvements:
elog(WARNING, ...)
, and get users aware of the fallback behavior;In this PR, I selected method-2, but I'm open to other feedbacks and suggestions.
The goal here is to disallow silent fallback and surprising write behavior.
Edit:
Followup on feedback #471 (comment), I fail the table creation if column type is not supported by duckdb.