Skip to content

Conversation

JelteF
Copy link
Collaborator

@JelteF JelteF commented Apr 16, 2025

DuckDB and Postgres can return different types for the same queries.
This can confuse Postgres in various ways when these queries are
involved in CTAS or materialized views. This fixes a bunch of issues
related to that and adds appropriate regression tests.

This includes a fix for the materialized view issue that was found in #583

@JelteF JelteF force-pushed the fix-type-issues-with-ctas-and-matview branch 4 times, most recently from e9d7c44 to 27c06bb Compare April 16, 2025 13:09
DuckDB and Postgres can return different types for the same queries.
This can confuse Postgres in various ways when these queries are
involved in CTAS or materialized views. This fixes a bunch of issues
related to that and adds appropriate regression tests.
@JelteF JelteF force-pushed the fix-type-issues-with-ctas-and-matview branch from 27c06bb to 09f63d1 Compare April 16, 2025 13:16
@JelteF JelteF requested a review from Y-- April 16, 2025 13:18
Comment on lines 316 to 317
auto save_nestlevel = NewGUCNestLevel();
SetConfigOption("duckdb.force_execution", "true", PGC_USERSET, PGC_S_SESSION);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have to go through the GUC? Why not using a different "force_execution" that would override it? Is it to limit the changes in this PR?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed now by calling DuckdbPlanNode directly.

Copy link
Collaborator

@Y-- Y-- left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one!

@JelteF JelteF merged commit 5770b1f into main Apr 16, 2025
6 checks passed
@JelteF JelteF deleted the fix-type-issues-with-ctas-and-matview branch April 16, 2025 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants