Skip to content

Conversation

Mytherin
Copy link
Collaborator

Fixes #8740
Fixes https://github.com/duckdblabs/duckdb-internal/issues/2269

This PR reworks table bindings so that they can have multiple components (catalog, schema, table) instead of being a flat string. This is accomplished through the BindingAlias class. This aligns the way that bindings work with what Postgres does as well, and enables queries like the following to run correctly:

create schema s1;
create schema s2;
create table s1.tbl(i int);
create table s2.tbl(i int);
select * from s1.tbl, s2.tbl;

In addition, we now fully qualify table names, allowing us to mix and match references to the tables including schemas/catalogs. This fixes queries like the following, which previously failed because i would not be considered as equivalent to s1.tbl.i.

create schema s1;
create table s1.tbl(i int);
select s1.tbl.i from s1.tbl group by i;

@Mytherin Mytherin merged commit e3dd358 into duckdb:feature Sep 18, 2024
35 of 39 checks passed
@Mytherin Mytherin deleted the fullyqualifiedfieldnames branch December 8, 2024 06:53
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.

1 participant