postgresql/src/backend
Tom Lane 318fd99ce7 Assert that we don't invent relfilenodes or type OIDs in binary upgrade.
During pg_upgrade's restore run, all relfilenode choices should be
overridden by commands in the dump script.  If we ever find ourselves
choosing a relfilenode in the ordinary way, someone blew it.  Likewise for
pg_type OIDs.  Since pg_upgrade might well succeed anyway, if there happens
not to be a conflict during the regression test run, we need assertions
here to keep us on the straight and narrow.

We might someday be able to remove the assertion in GetNewRelFileNode,
if pg_upgrade is rewritten to remove its assumption that old and new
relfilenodes always match.  But it's hard to see how to get rid of the
pg_type OID constraint, since those OIDs are embedded in user tables
in some cases.

Back-patch as far as 9.5, because of the risk of back-patches breaking
something here even if it works in HEAD.  I'd prefer to go back further,
but 9.4 fails both assertions due to get_rel_infos()'s use of a temporary
table.  We can't use the later-branch solution of a CTE for compatibility
reasons (cf commit 5d16332e9), and it doesn't seem worth inventing some
other way to do the query.  (I did check, by dint of changing the Asserts
to elog(WARNING), that there are no other cases of unwanted OID assignments
during 9.4's regression test run.)

Discussion: https://postgr.es/m/19785.1497215827@sss.pgh.pa.us
2017-06-12 20:04:33 -04:00
..
access Prevent possibility of panics during shutdown checkpoint. 2017-06-05 19:18:16 -07:00
bootstrap Add macros to make AllocSetContextCreate() calls simpler and safer. 2016-08-27 17:50:38 -04:00
catalog Assert that we don't invent relfilenodes or type OIDs in binary upgrade. 2017-06-12 20:04:33 -04:00
commands Assorted translatable string fixes 2017-06-04 11:41:16 -04:00
executor Avoid passing function pointers across process boundaries. 2017-04-15 16:23:27 -04:00
foreign Remove GetUserMappingId() and GetUserMappingById(). 2016-07-22 11:32:23 -04:00
lib Revert "Permit dump/reload of not-too-large >1GB tuples" 2016-12-06 12:46:03 -03:00
libpq Fix unportable disregard of alignment requirements in RADIUS code. 2017-03-26 17:35:35 -04:00
main Repair a bit of pgindent damage. 2016-06-09 18:09:17 -04:00
nodes Fix parallel query so it doesn't spoil row estimates above Gather. 2017-03-31 21:10:30 -04:00
optimizer Always build a custom plan node's targetlist from the path's pathtarget. 2017-04-17 15:29:00 -04:00
parser Allow NumericOnly to be "+ FCONST". 2017-05-29 15:19:07 -04:00
po Translation updates 2017-05-08 10:10:54 -04:00
port Provide a way to control SysV shmem attach address in EXEC_BACKEND builds. 2017-04-15 17:27:51 -04:00
postmaster Try to ensure that stats collector's receive buffer size is at least 100KB. 2017-05-29 20:27:45 -04:00
regex Fix regexport.c to behave sanely with lookaround constraints. 2017-04-13 17:18:35 -04:00
replication Unify SIGHUP handling between normal and walsender backends. 2017-06-05 19:18:16 -07:00
rewrite RLS: Fix ALL vs. SELECT+UPDATE policy usage 2017-05-06 21:46:41 -04:00
snowball Update copyright for 2016 2016-01-02 13:33:40 -05:00
storage Prevent possibility of panics during shutdown checkpoint. 2017-06-05 19:18:16 -07:00
tcop Unify SIGHUP handling between normal and walsender backends. 2017-06-05 19:18:16 -07:00
tsearch Fix typos in comments. 2017-02-06 11:34:15 +02:00
utils Unify SIGHUP handling between normal and walsender backends. 2017-06-05 19:18:16 -07:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
common.mk Remove maintainer-check target, fold into normal build 2013-10-10 20:11:56 -04:00
Makefile Provide and use a makefile target to build all generated headers. 2016-07-01 15:09:02 -04:00
nls.mk Translation updates 2017-02-06 12:42:47 -05:00