Re: making relfilenodes 56 bits
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: Dilip Kumar <dilipbalaut@gmail.com>
Cc: Amit Kapila <amit.kapila16@gmail.com>, Andres Freund <andres@anarazel.de>, Heikki Linnakangas <hlinnaka@iki.fi>, Thomas Munro <thomas.munro@gmail.com>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2022-09-06T17:37:13Z
Lists: pgsql-hackers
On Tue, Sep 6, 2022 at 4:40 AM Dilip Kumar <dilipbalaut@gmail.com> wrote: > I have explored this area more and also tried to come up with a > working prototype, so while working on this I realized that we would > have almost to execute all the code which is getting generated as part > of the dumpDatabase() and dumpACL() which is basically, > > 1. UPDATE pg_catalog.pg_database SET datistemplate = false > 2. DROP DATABASE > 3. CREATE DATABASE with all the database properties like ENCODING, > LOCALE_PROVIDER, LOCALE, LC_COLLATE, LC_CTYPE, ICU_LOCALE, > COLLATION_VERSION, TABLESPACE > 4. COMMENT ON DATABASE > 5. Logic inside dumpACL() > > I feel duplicating logic like this is really error-prone, but I do not > find any clear way to reuse the code as dumpDatabase() has a high > dependency on the Archive handle and generating the dump file. Yeah, I don't think this is the way to go at all. The duplicated logic is likely to get broken, and is also likely to annoy the next person who has to maintain it. I suggest that for now we fall back on making the initial RelFileNumber for a system table equal to pg_class.oid. I don't really love that system and I think maybe we should change it at some point in the future, but all the alternatives seem too complicated to cram them into the current patch. -- Robert Haas EDB: http://www.enterprisedb.com
Commits
-
Fix typos in comments, code and documentation
- 33ab0a2a527e 16.0 cited
-
Increase width of RelFileNumbers from 32 bits to 56 bits.
- 05d4cbf9b6ba 16.0 landed
-
Move RelFileNumber declarations to common/relpath.h.
- 2f47715cc864 16.0 landed
-
Include RelFileLocator fields individually in BufferTag.
- 82ac34db2036 16.0 landed
-
Convert macros to static inline functions (buf_internals.h)
- 3ac88fddd92c 16.0 landed
-
Remove the restriction that the relmap must be 512 bytes.
- d8cd0c6c95c0 16.0 landed
-
Change internal RelFileNode references to RelFileNumber or RelFileLocator.
- b0a55e43299c 16.0 landed
-
Reorder subskiplsn in pg_subscription to avoid alignment issues.
- 79b716cfb7a1 15.0 cited
-
Fix DROP {DATABASE,TABLESPACE} on Windows.
- 4eb2176318d0 15.0 cited
-
Restructure smgr API as per recent proposal. smgr no longer depends on
- 87bd95638552 8.0.0 cited