Fix CREATE DATABASE so we can pg_upgrade DBs with OIDs above 2^31.

Tom Lane <tgl@sss.pgh.pa.us>

Commit: 2c6d43650d16d91a3e731d236315beffd98db729
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2022-11-04T14:39:52Z
Releases: 15.1
Fix CREATE DATABASE so we can pg_upgrade DBs with OIDs above 2^31.

Commit aa0105141 repeated one of the oldest mistakes in our book:
thinking that OID is the same as int32.  It isn't of course, and
unsurprisingly the first person who came along with a database
OID above 2 billion broke it.  Repair.

Per bug #17677 from Sergey Pankov.  Back-patch to v15.

Discussion: https://postgr.es/m/17677-a99fa067d7ed71c9@postgresql.org

Files

Discussion