From: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> |
---|---|
To: | Desmond Coertzen <patrolliekaptein(at)gmail(dot)com> |
Cc: | "pgsql-sql(at)postgresql(dot)org" <pgsql-sql(at)postgresql(dot)org> |
Subject: | Re: Subselect left join / not exists() |
Date: | 2016-02-26 14:53:46 |
Message-ID: | CAKFQuwYj-LXJxF8NNqVrEXnyXPVACDmaP6Qy3kgYUCaWZ5bK2A@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
On Fri, Feb 26, 2016 at 4:17 AM, Desmond Coertzen <
patrolliekaptein(at)gmail(dot)com> wrote:
>
> It's not the best DB design but the query without the null test and the
> max aggregate should have worked. I am convinced there must be a bug
> exposed when doing nested sub queries on the same table and the bug may
> show itself the deeper you stack - stack meaning nested subselect on the
> same table. I am also convinced that I am completely insane and may be
> missing something very obvious like a noob.
>
> Any help/comment highly appreciated in advance.
>
If you deign to provide a self-contained test case showing where the
non-aggregated query provides bogus results while the aggregated and
limited one does not we would be most greatful since we could then test
whether what you are seeing exists in a release of PostgreSQL that is
currently supported. And if the behavior is correct we would have concrete
values that could be used the in the explanation of said behavior.
Don't expect us to be able to upgrade the quality of the discussion: If the
best you can give us is phrases like "weird" and "bogus" to describe what
you are seeing, and no explicit schema definitions, then they best I can
say is that while this looks odd it is likely explainable and a direct
function of the fact that "it's not the best DB design" and that because of
such there are data anomalies that are potentially coming into play here.
Or its a bug - potentially one that has been fixed.
David J.
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2016-02-26 15:00:05 | Re: Subselect left join / not exists() |
Previous Message | Stuart | 2016-02-26 12:28:07 | Re: Query about foreign key details for php framework |