pgsql: Add a new column to pg_am to specify whether an index AM supports

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Add a new column to pg_am to specify whether an index AM supports
Date: 2008-10-17 22:10:30
Message-ID: 20081017221030.2463A7545A4@cvs.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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)

Browse pgsql-committers by date

  From Date Subject
Next Message Alvaro Herrera 2008-10-17 22:56:16 pgsql: Refactor some duplicate code to set up formatted_log_time and
Previous Message Tom Lane 2008-10-17 20:27:24 pgsql: Salvage a little bit of work from a failed patch: simplify and