diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2022-11-04 10:39:52 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2022-11-04 10:39:52 -0400 |
commit | 2c6d43650d16d91a3e731d236315beffd98db729 (patch) | |
tree | b4a48d893a7a7c11a7195928f719057bd4bb6cda /src/backend/commands/dbcommands.c | |
parent | 81173264440d7d3bd6479313b1d4611a2bfe8031 (diff) | |
download | postgresql-2c6d43650d16d91a3e731d236315beffd98db729.tar.gz postgresql-2c6d43650d16d91a3e731d236315beffd98db729.zip |
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
Diffstat (limited to 'src/backend/commands/dbcommands.c')
-rw-r--r-- | src/backend/commands/dbcommands.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/commands/dbcommands.c b/src/backend/commands/dbcommands.c index 034d14f39da..5f342478296 100644 --- a/src/backend/commands/dbcommands.c +++ b/src/backend/commands/dbcommands.c @@ -815,7 +815,7 @@ createdb(ParseState *pstate, const CreatedbStmt *stmt) } else if (strcmp(defel->defname, "oid") == 0) { - dboid = defGetInt32(defel); + dboid = defGetObjectId(defel); /* * We don't normally permit new databases to be created with |