RE: Postgres turns LEFT JOIN into INNER JOIN - incorrect results

From: Floris Van Nee <florisvannee(at)Optiver(dot)com>
To: Pantelis Theodosiou <ypercube(at)gmail(dot)com>, "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: RE: Postgres turns LEFT JOIN into INNER JOIN - incorrect results
Date: 2021-06-15 13:56:10
Message-ID: 928a013baac445b2b280d6ab3ad78fa5@opammb0562.comp.optiver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


> It works correctly if you rename the column name to anything other than _a :
>
>    CREATE OR REPLACE FUNCTION test_internal(_a text)
>   RETURNS TABLE(a text)                      -- <- different than _a
>    LANGUAGE sql

> It also works if you rename the parameter (_a) here with something else.

Ah, of course! Sorry for the confusion.. The return column shadows the parameter in the outer function...
Thanks for the explanation! No bug, just accidentally naming the returned column wrong.

-Floris

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2021-06-15 14:05:02 Re: Postgres turns LEFT JOIN into INNER JOIN - incorrect results
Previous Message Floris Van Nee 2021-06-15 13:06:27 Postgres turns LEFT JOIN into INNER JOIN - incorrect results