From: | Don Seiler <don(at)seiler(dot)us> |
---|---|
To: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> |
Cc: | Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org> |
Subject: | Re: Dangerous Naming Confusion |
Date: | 2021-03-30 13:48:19 |
Message-ID: | CAHJZqBCSq34iXhHaCY4pe-0JVo-HodwTbxs8qE=LBqqHwGnT1Q@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Mon, Mar 29, 2021 at 5:22 PM David G. Johnston <
david(dot)g(dot)johnston(at)gmail(dot)com> wrote:
> On Mon, Mar 29, 2021 at 3:20 PM Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
> wrote:
>
>> On 3/29/21 3:00 PM, Don Seiler wrote:
>> >
>> > I'm wondering if this is expected behavior that PG uses the
>> > dts_orders.order_id value in the subquery "select order_id from
>> > dts_temp" when dts_temp doesn't have its own order_id column. I would
>> > have expected an error that the column doesn't exist. Seems very
>> > counter-intuitive to think PG would use a column from a different table.
>>
>> See:
>>
>>
>> https://www.postgresql.org/message-id/Pine.LNX.4.56.0308011345320.881@krusty.credativ.de
>>
>>
> There is also an FAQ entry:
>
>
> https://wiki.postgresql.org/wiki/FAQ#Why_doesn.27t_PostgreSQL_report_a_column_not_found_error_when_using_the_wrong_name_in_a_subquery.3F
>
> David J.
>
>
This is good to know. I figured it might "working as expected". Still seems
annoying/counter-intuitive to me but at least we know to look for it.
Thanks,
Don.
--
Don Seiler
www.seiler.us
From | Date | Subject | |
---|---|---|---|
Next Message | Susan Joseph | 2021-03-30 14:09:49 | Upgrading from 11 to 13 |
Previous Message | Luca Ferrari | 2021-03-30 06:38:34 | Re: questions about wraparound |