Skip to content

Conversation

JelteF
Copy link
Collaborator

@JelteF JelteF commented Feb 26, 2025

This starts supporting DuckDB DDL in transactions. There are still some limitations, but the most common use cases should now work as expected. For the cases that are disallowed, it's possible to disable the mixed-writes detection by setting duckdb.unsafe_allow_mixed_transactions to true. This is not recommended for most usage, but it is a useful escape hatch for cases where people cannot manually control the transaction end/start.

A major change this does in the detection is that it starts to completely rely on CommandId for detecting Postgres writes. Previously we also looked at WAL, but it turns out that is very unreliable, because even read queries can trigger WAL writes (e.g. to update hint bits).

@JelteF JelteF force-pushed the motherduck-ddl-in-transactions branch 6 times, most recently from ef82bfa to b8fe67c Compare February 27, 2025 09:47
@JelteF JelteF requested a review from mkaruza February 27, 2025 09:47
@JelteF JelteF force-pushed the motherduck-ddl-in-transactions branch from b8fe67c to bf9b512 Compare February 27, 2025 09:48
@JelteF JelteF force-pushed the motherduck-ddl-in-transactions branch from 59bd596 to d6d6954 Compare February 27, 2025 13:55
@JelteF JelteF merged commit 8289cf1 into main Mar 4, 2025
5 checks passed
@JelteF JelteF deleted the motherduck-ddl-in-transactions branch March 4, 2025 16:38
JelteF added a commit that referenced this pull request Mar 5, 2025
This fixes a handful of issues with MotherDuck tables that I ran into
while implementing automated testing for MotherDuck integration:

1. When creating a table in a `ddb$` schema, default that table to be an
MD table.
2. Do not allow creating non-MD tables in `ddb$` schemas when explicitly
specifying another Table AM (like `heap`).
3. When creating MD tables, automatically make them owned by
`duckdb.postgres_role`
4. Fix syncing of MotherDuck tables. This was broken by #632
5. Fix escaping of a MotherDuck schema name when syncing schema names
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