From: Floris Van Nee <florisvannee@Optiver.com>
To: Pantelis Theodosiou <ypercube@gmail.com>
To: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
Subject: RE: Postgres turns LEFT JOIN into INNER JOIN - incorrect results
Date: Tue, 15 Jun 2021 13:56:10 +0000
Message-ID: <928a013baac445b2b280d6ab3ad78fa5@opammb0562.comp.optiver.com> (raw)
In-Reply-To: <CAE3TBxyfLVrRDraxXy4wT_Y68DRad8F4YPs+RGgpXqT1GjmfFA@mail.gmail.com>
References: <dfb0057d6a8d4b4f8a63330dd621d4b1@opammb0562.comp.optiver.com>
<CAE3TBxyfLVrRDraxXy4wT_Y68DRad8F4YPs+RGgpXqT1GjmfFA@mail.gmail.com>
> 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: florisvannee@Optiver.com, ypercube@gmail.com, pgsql-bugs@lists.postgresql.org
Subject: RE: Postgres turns LEFT JOIN into INNER JOIN - incorrect results
In-Reply-To: <928a013baac445b2b280d6ab3ad78fa5@opammb0562.comp.optiver.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox