Skip to content
Discussion options

You must be logged in to vote

This changed in DuckDB 2.0.0. The 2.0 release notes explicitly list rel.query(name, sql) leaving no temporary view behind, and add the three relational operations you mentioned.

I reproduced the rebinding and catalog growth with the official 1.5.6 wheel, then ran the same checks with 2.0.0 on CPython 3.14.7. On 2.0.0 this works without obtaining the relation's connection or doing cleanup:

import duckdb

con = duckdb.connect()
a = con.sql("SELECT 1 AS x").query("input_data", "SELECT x + 10 AS x FROM input_data")
assert a.fetchall() == [(11,)]
b = con.sql("SELECT 2 AS x").query("input_data", "SELECT x + 10 AS x FROM input_data")
assert a.fetchall() == [(11,)]  # 1.5.6 instead returns [(12,)…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by evertlammerts
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants