Fix use of cursor sensitivity terminology
authorPeter Eisentraut <peter@eisentraut.org>
Wed, 7 Apr 2021 05:49:27 +0000 (07:49 +0200)
committerPeter Eisentraut <peter@eisentraut.org>
Wed, 7 Apr 2021 06:05:55 +0000 (08:05 +0200)
commitdd13ad9d39a1ba41cf329b6fe408b49be57c7b88
treee75e26cae720ad2f4a0e1d8ef071ae197924c45a
parent0b5e8245283eef67e88fb5380836cdc2c743d848
Fix use of cursor sensitivity terminology

Documentation and comments in code and tests have been using the terms
sensitive/insensitive cursor incorrectly relative to the SQL standard.
(Cursor sensitivity is only relevant for changes made in the same
transaction as the cursor, not for concurrent changes in other
sessions.)  Moreover, some of the behavior of PostgreSQL is incorrect
according to the SQL standard, confusing the issue further.  (WHERE
CURRENT OF changes are not visible in insensitive cursors, but they
should be.)

This change corrects the terminology and removes the claim that
sensitive cursors are supported.  It also adds a test case that checks
the insensitive behavior in a "correct" way, using a change command
not using WHERE CURRENT OF.  Finally, it adds the ASENSITIVE cursor
option to select the default asensitive behavior, per SQL standard.

There are no changes to cursor behavior in this patch.

Discussion: https://www.postgresql.org/message-id/flat/96ee8b30-9889-9e1b-b053-90e10c050e85%40enterprisedb.com
doc/src/sgml/ecpg.sgml
doc/src/sgml/ref/declare.sgml
src/backend/catalog/sql_features.txt
src/backend/parser/analyze.c
src/backend/parser/gram.y
src/bin/psql/tab-complete.c
src/include/nodes/parsenodes.h
src/include/parser/kwlist.h
src/test/regress/expected/portals.out
src/test/regress/sql/portals.sql