Implement comparison of generic records (composite types), and invent a
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 13 Oct 2008 16:25:20 +0000 (16:25 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 13 Oct 2008 16:25:20 +0000 (16:25 +0000)
commitc52c21a176e21bf40452c98df87f65ed1546993c
tree6d26085040e65263bf8b38f141f60d31a6cb85c7
parentdefed30d8c10a96d149c085527a7503f66dc5e9a
Implement comparison of generic records (composite types), and invent a
pseudo-type record[] to represent arrays of possibly-anonymous composite
types.  Since composite datums carry their own type identification, no
extra knowledge is needed at the array level.

The main reason for doing this right now is that it is necessary to support
the general case of detection of cycles in recursive queries: if you need to
compare more than one column to detect a cycle, you need to compare a ROW()
to an array built from ROW()s, at least if you want to do it as the spec
suggests.  Add some documentation and regression tests concerning the cycle
detection issue.
18 files changed:
doc/src/sgml/func.sgml
doc/src/sgml/queries.sgml
src/backend/commands/indexcmds.c
src/backend/parser/parse_coerce.c
src/backend/utils/adt/rowtypes.c
src/include/catalog/catversion.h
src/include/catalog/pg_amop.h
src/include/catalog/pg_amproc.h
src/include/catalog/pg_opclass.h
src/include/catalog/pg_operator.h
src/include/catalog/pg_opfamily.h
src/include/catalog/pg_proc.h
src/include/catalog/pg_type.h
src/include/utils/builtins.h
src/test/regress/expected/rowtypes.out
src/test/regress/expected/with.out
src/test/regress/sql/rowtypes.sql
src/test/regress/sql/with.sql