Re: Comment - uniqueness of relfilenode

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Antonin Houska <antonin(dot)houska(at)gmail(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Comment - uniqueness of relfilenode
Date: 2013-11-09 23:57:36
Message-ID: CA+TgmoYwRm6C6m4Wg+QU30G69WOEm7QZ0XKkGWAxT-BPA2dYYw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Nov 7, 2013 at 10:56 AM, Antonin Houska
<antonin(dot)houska(at)gmail(dot)com> wrote:
> catalog/catalog.c:GetNewRelFileNode() and its calls indicate that the
> following change makes sense:
>
>
> diff --git a/src/include/storage/relfilenode.h
> b/src/include/storage/relfilenode.h
> index 75f897f..7190974 100644
> --- a/src/include/storage/relfilenode.h
> +++ b/src/include/storage/relfilenode.h
> @@ -55,7 +55,7 @@ typedef enum ForkNumber
> * relNode identifies the specific relation. relNode corresponds to
> * pg_class.relfilenode (NOT pg_class.oid, because we need to be able
> * to assign new physical files to relations in some situations).
> - * Notice that relNode is only unique within a particular database.
> + * Notice that relNode is only unique within a particular tablespace.
> *
> * Note: spcNode must be GLOBALTABLESPACE_OID if and only if dbNode is
> * zero. We support shared relations only in the "global" tablespace.
>
>
> // Antonin Houska (Tony)

Technically speaking, I think it's only guaranteed to be unique with a
database-tablespace combination. In other words, the same OID can be
reused as a relfilenode if *either* of those two values differs.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2013-11-10 00:15:05 Re: "Fix pg_isolation_regress to work outside its build directory" compiler warning
Previous Message Robert Haas 2013-11-09 23:47:33 Re: Race condition in b-tree page deletion