pgsql: Add a new column to pg_am to specify whether an index AM supports - Mailing list pgsql-committers

From tgl@postgresql.org (Tom Lane)
Subject pgsql: Add a new column to pg_am to specify whether an index AM supports
Date
Msg-id 20081017221030.2463A7545A4@cvs.postgresql.org
Whole thread Raw
List pgsql-committers
Log Message:
-----------
Add a new column to pg_am to specify whether an index AM supports backward
scanning; GiST and GIN do not, and it seems like too much trouble to make
them do so.  By teaching ExecSupportsBackwardScan() about this restriction,
we ensure that the planner will protect a scroll cursor from the problem
by adding a Materialize node.

In passing, fix another longstanding bug in the same area: backwards scan of
a plan with set-returning functions in the targetlist did not work either,
since the TupFromTlist expansion code pays no attention to direction (and
has no way to run a SRF backwards anyway).  Again the fix is to make
ExecSupportsBackwardScan check this restriction.

Also adjust the index AM API specification to note that mark/restore support
is unnecessary if the AM can't produce ordered output.

Modified Files:
--------------
    pgsql/doc/src/sgml:
        catalogs.sgml (r2.178 -> r2.179)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/doc/src/sgml/catalogs.sgml?r1=2.178&r2=2.179)
        indexam.sgml (r2.27 -> r2.28)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/doc/src/sgml/indexam.sgml?r1=2.27&r2=2.28)
    pgsql/src/backend/executor:
        execAmi.c (r1.99 -> r1.100)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/executor/execAmi.c?r1=1.99&r2=1.100)
    pgsql/src/include/catalog:
        catversion.h (r1.498 -> r1.499)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/catversion.h?r1=1.498&r2=1.499)
        pg_am.h (r1.58 -> r1.59)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/pg_am.h?r1=1.58&r2=1.59)

pgsql-committers by date:

Previous
From: tgl@postgresql.org (Tom Lane)
Date:
Subject: pgsql: Salvage a little bit of work from a failed patch: simplify and
Next
From: alvherre@postgresql.org (Alvaro Herrera)
Date:
Subject: pgsql: Refactor some duplicate code to set up formatted_log_time and