Re: BUG #18307: system columns does not support using join

From: RekGRpth <rekgrpth(at)gmail(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #18307: system columns does not support using join
Date: 2024-01-25 03:33:47
Message-ID: CAPgh2mJv1i00b_f7Eqv+vOEAehz5AbmX6GorBjL81Vr1aJjApg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Thanks, I'll look into it.

explain (costs off) select t.xmin from t join t tt on t.xmin = tt.xmin;
QUERY PLAN
---------------------------------
Hash Join
Hash Cond: (t.xmin = tt.xmin)
-> Seq Scan on t
-> Hash
-> Seq Scan on t tt
(5 rows)

explain (costs off) select t.xmin from t join t tt using (xmin);
ERROR: column "xmin" specified in USING clause does not exist in left table

explain (costs off) select tt.xmin from t join t tt using (xmin);
ERROR: column "xmin" specified in USING clause does not exist in left table

explain (costs off) select t.xmin, tt.xmin from t join t tt using (xmin);
ERROR: column "xmin" specified in USING clause does not exist in left table

ср, 24 янв. 2024 г. в 19:26, David G. Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>:
>
> On Tuesday, January 23, 2024, PG Bug reporting form <noreply(at)postgresql(dot)org> wrote:
>>
>> The following bug has been logged on the website:
>>
>> Bug reference: 18307
>> Logged by: RekGRpth
>> Email address: rekgrpth(at)gmail(dot)com
>> PostgreSQL version: 16.1
>> Operating system: docker alpine
>> Description:
>>
>> create table t(i int);
>>
>> explain (costs off) select * from t join t tt on t.xmin = tt.xmin;
>> QUERY PLAN
>> ---------------------------------
>> Hash Join
>> Hash Cond: (t.xmin = tt.xmin)
>> -> Seq Scan on t
>> -> Hash
>> -> Seq Scan on t tt
>> (5 rows)
>>
>> explain (costs off) select * from t join t tt using (xmin);
>> ERROR: column "xmin" specified in USING clause does not exist in left table
>
>
> I don’t this being worth the effort to change, and really seems like completely expected behavior. “Select *” doesn’t output xmin, it requires explicit table qualification to see it. This is the same thing.
>
> David J.
>

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2024-01-25 03:54:10 Re: BUG #18307: system columns does not support using join
Previous Message Matthew Gabeler-Lee 2024-01-24 17:52:57 Re: BUG #18156: Self-referential foreign key in partitioned table not enforced on deletes