pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robert Haas <rhaas@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Change struct tablespaceinfo's oid member from 'char *' to 'Oid'
Date: Mon, 23 Oct 2023 19:23:23 +0000
Message-ID: <E1qv0WJ-0020X9-HV@gemulon.postgresql.org> (raw)

Change struct tablespaceinfo's oid member from 'char *' to 'Oid'

This shouldn't change behavior except in the unusual case where
there are file in the tablespace directory that have entirely
numeric names but are nevertheless not possible names for a
tablespace directory, either because their names have leading zeroes
that shouldn't be there, or the value is actually zero, or because
the value is too large to represent as an OID.

In those cases, the directory would previously have made it into
the list of tablespaceinfo objects and no longer will. Thus, base
backups will now ignore such directories, instead of treating them
as legitimate tablespace directories. Similarly, if entries for
such tablespaces occur in a tablespace_map file, they will now
be rejected as erroneous, instead of being honored.

This is infrastructure for future work that wants to be able to
know the tablespace of each relation that is part of a backup
*as an OID*. By strengthening the up-front validation, we don't
have to worry about weird cases later, and can more easily avoid
repeated string->integer conversions.

Patch by me, reviewed by David Steele.

Discussion: http://postgr.es/m/CA+TgmoZNVeBzoqDL8xvr-nkaepq815jtDR4nJzPew7=3iEuM1g@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/5b36e8f078a3c68fd1c530c59c4ed961c15c7ab4

Modified Files
--------------
src/backend/access/transam/xlog.c         | 19 ++++++++++++++---
src/backend/access/transam/xlogrecovery.c | 12 ++++++++---
src/backend/backup/backup_manifest.c      |  6 +++---
src/backend/backup/basebackup.c           | 35 ++++++++++++++++---------------
src/backend/backup/basebackup_copy.c      |  2 +-
src/include/backup/backup_manifest.h      |  2 +-
src/include/backup/basebackup.h           |  2 +-
7 files changed, 49 insertions(+), 29 deletions(-)



Message-ID: <E1qv0WJ-0020X9-HV@gemulon.postgresql.org>
Permalink:  ../E1qv0WJ-0020X9-HV@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1qv0WJ-0020X9-HV@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: rhaas@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Change struct tablespaceinfo's oid member from 'char *' to 'Oid'
  In-Reply-To: <E1qv0WJ-0020X9-HV@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox