postgresql/src
Peter Eisentraut 20e58105ba Separate equalRowTypes() from equalTupleDescs()
This introduces a new function equalRowTypes() that is effectively a
subset of equalTupleDescs() but only compares the number of attributes
and attribute name, type, typmod, and collation.  This is enough for
most existing uses of equalTupleDescs(), which are changed to use the
new function.  The only remaining callers of equalTupleDescs() are
those that really want to check the full tuple descriptor as such,
without concern about record or row or record type semantics.

The existing function hashTupleDesc() is renamed to hashRowType(),
because it now corresponds more to equalRowTypes().

The purpose of this change is to be clearer about the semantics of the
equality asked for by each caller.  (At least one caller had a comment
that questioned whether equalTupleDescs() was too restrictive.)  For
example, 4f622503d6 removed attstattarget from the tuple descriptor
structure.  It was not fully clear at the time how this should affect
equalTupleDescs().  Now the answer is clear: By their own definitions,
equalRowTypes() does not care, and equalTupleDescs() just compares
whatever is in the tuple descriptor but does not care why it is in
there.

Reviewed-by: Tomas Vondra <tomas.vondra@enterprisedb.com>
Discussion: https://www.postgresql.org/message-id/flat/f656d6d9-6660-4518-a006-2f65cafbebd1%40eisentraut.org
2024-03-17 05:58:04 +01:00
..
backend Separate equalRowTypes() from equalTupleDescs() 2024-03-17 05:58:04 +01:00
bin Add destroyStringInfo function for cleaning up StringInfos 2024-03-16 23:18:28 +01:00
common Add destroyStringInfo function for cleaning up StringInfos 2024-03-16 23:18:28 +01:00
fe_utils Centralize logic for restoring errno in signal handlers. 2024-02-14 16:34:18 -06:00
include Separate equalRowTypes() from equalTupleDescs() 2024-03-17 05:58:04 +01:00
interfaces Make the order of the header file includes consistent 2024-03-13 15:07:00 +01:00
makefiles Remove AIX support 2024-02-28 15:17:23 +04:00
pl Make the order of the header file includes consistent 2024-03-13 15:07:00 +01:00
port Use printf's %m format instead of strerror(errno) in more places 2024-03-12 10:02:54 +09:00
template Remove AIX support 2024-02-28 15:17:23 +04:00
test Add destroyStringInfo function for cleaning up StringInfos 2024-03-16 23:18:28 +01:00
timezone Update time zone data files to tzdata release 2024a. 2024-02-01 15:57:53 -05:00
tools Put genbki.pl output into src/include/catalog/ directly 2024-03-14 07:11:21 +01:00
tutorial Update copyright for 2024 2024-01-03 20:49:05 -05:00
.gitignore
DEVELOPERS
Makefile Remove distprep 2023-11-06 15:18:04 +01:00
Makefile.global.in Remove make function vpathsearch 2024-01-29 07:24:59 +01:00
Makefile.shlib Remove AIX support 2024-02-28 15:17:23 +04:00
meson.build Update copyright for 2024 2024-01-03 20:49:05 -05:00
nls-global.mk Remove distprep 2023-11-06 15:18:04 +01:00