select_common_typmod

Peter Eisentraut <peter.eisentraut@2ndquadrant.com>

From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2020-10-20T08:58:18Z
Lists: pgsql-hackers

Attachments

While working on another patch, I figured adding a 
select_common_typmod() to go along with select_common_type() and 
select_common_collation() would be handy.  Typmods were previously 
combined using hand-coded logic in several places, and not at all in 
other places.  The logic in select_common_typmod() isn't very exciting, 
but it makes the code more compact and readable in a few locations, and 
in the future we can perhaps do more complicated things if desired.

There might have been a tiny bug in transformValuesClause() because 
while consolidating the typmods it does not take into account whether 
the types are actually the same (as more correctly done in 
transformSetOperationTree() and buildMergedJoinVar()).

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Commits

  1. Add select_common_typmod()