pgsql: Fix a bug introduced when set-returning SQL functions were made - Mailing list pgsql-committers

From tgl@postgresql.org (Tom Lane)
Subject pgsql: Fix a bug introduced when set-returning SQL functions were made
Date
Msg-id 20091214021605.E3B73753FBC@cvs.postgresql.org
Whole thread Raw
List pgsql-committers
Log Message:
-----------
Fix a bug introduced when set-returning SQL functions were made inline-able:
we have to cope with the possibility that the declared result rowtype contains
dropped columns.  This fails in 8.4, as per bug #5240.

While at it, be more paranoid about inserting binary coercions when inlining.
The pre-8.4 code did not really need to worry about that because it could not
inline at all in any case where an added coercion could change the behavior
of the function's statement.  However, when inlining a SRF we allow sorting,
grouping, and set-ops such as UNION.  In these cases, modifying one of the
targetlist entries that the sort/group/setop depends on could conceivably
change the behavior of the function's statement --- so don't inline when
such a case applies.

Tags:
----
REL8_4_STABLE

Modified Files:
--------------
    pgsql/src/backend/catalog:
        pg_proc.c (r1.164.2.1 -> r1.164.2.2)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/catalog/pg_proc.c?r1=1.164.2.1&r2=1.164.2.2)
    pgsql/src/backend/executor:
        execQual.c (r1.250 -> r1.250.2.1)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/execQual.c?r1=1.250&r2=1.250.2.1)
        functions.c (r1.135 -> r1.135.2.1)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/functions.c?r1=1.135&r2=1.135.2.1)
    pgsql/src/backend/optimizer/util:
        clauses.c (r1.277 -> r1.277.2.1)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/util/clauses.c?r1=1.277&r2=1.277.2.1)
    pgsql/src/include/executor:
        functions.h (r1.33 -> r1.33.2.1)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/executor/functions.h?r1=1.33&r2=1.33.2.1)
    pgsql/src/test/regress/expected:
        rangefuncs.out (r1.22 -> r1.22.2.1)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/expected/rangefuncs.out?r1=1.22&r2=1.22.2.1)
    pgsql/src/test/regress/sql:
        rangefuncs.sql (r1.11 -> r1.11.2.1)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/sql/rangefuncs.sql?r1=1.11&r2=1.11.2.1)

pgsql-committers by date:

Previous
From: tgl@postgresql.org (Tom Lane)
Date:
Subject: pgsql: Fix a bug introduced when set-returning SQL functions were made
Next
From: bmomjian@pgfoundry.org (User Bmomjian)
Date:
Subject: pg-migrator - pg_migrator: Wording improvements.