Re: Comment - uniqueness of relfilenode

From: Bruce Momjian <bruce(at)momjian(dot)us>
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: 2014-03-06 01:54:40
Message-ID: 20140306015440.GF20275@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Nov 11, 2013 at 05:48:52PM +0100, Antonin Houska wrote:
> On 11/10/2013 12:57 AM, Robert Haas wrote:
> > 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.
>
> You're right. I missed the fact that Postgres (unlike another DBMS that
> I worked with) allows for tablespace to be shared across databases.

I have update the C comment:

< * Notice that relNode is only unique within a particular database.
---
> * Notice that relNode is only unique within a particular tablespace.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ Everyone has their own god. +

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Craig Ringer 2014-03-06 01:56:24 Re: Row-security on updatable s.b. views
Previous Message Bruce Momjian 2014-03-06 01:46:21 Re: Documentation patch for date/time formatting functions