Thread: Comment - uniqueness of relfilenode
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 ifand only if dbNode is * zero. We support shared relations only in the "global" tablespace. // Antonin Houska (Tony)
On Thu, Nov 7, 2013 at 10:56 AM, Antonin Houska <antonin.houska@gmail.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
On 11/10/2013 12:57 AM, Robert Haas wrote: > On Thu, Nov 7, 2013 at 10:56 AM, Antonin Houska > <antonin.houska@gmail.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. // Antonin Houska (Tony)
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.houska@gmail.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 aparticular tablespace. -- Bruce Momjian <bruce@momjian.us> http://momjian.us EnterpriseDB http://enterprisedb.com + Everyone has their own god. +
On Wed, Mar 5, 2014 at 8:54 PM, Bruce Momjian <bruce@momjian.us> wrote: > 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.houska@gmail.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. Yep. But the new text is no more correct than the old text. Did you read what I wrote upthread? -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company
On 03/06/2014 04:33 AM, Robert Haas wrote: > On Wed, Mar 5, 2014 at 8:54 PM, Bruce Momjian <bruce@momjian.us> wrote: >> 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.houska@gmail.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. > > Yep. But the new text is no more correct than the old text. Did you > read what I wrote upthread? Perhaps "... unique within a particular (tablespace, database) combination." ? // Tony
On Thu, Mar 6, 2014 at 08:34:29AM +0100, Antonin Houska wrote: > >>> 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. > > > > Yep. But the new text is no more correct than the old text. Did you > > read what I wrote upthread? > > Perhaps "... unique within a particular (tablespace, database) > combination." ? Oh, I thought people just wanted the text to be consistent with other mentions, rather than improving it. Attached is a patch which updates comments about the tablespace/database issue. -- Bruce Momjian <bruce@momjian.us> http://momjian.us EnterpriseDB http://enterprisedb.com + Everyone has their own god. +
Attachment
On Thu, Mar 6, 2014 at 09:20:39PM -0500, Bruce Momjian wrote: > On Thu, Mar 6, 2014 at 08:34:29AM +0100, Antonin Houska wrote: > > >>> 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. > > > > > > Yep. But the new text is no more correct than the old text. Did you > > > read what I wrote upthread? > > > > Perhaps "... unique within a particular (tablespace, database) > > combination." ? > > Oh, I thought people just wanted the text to be consistent with other > mentions, rather than improving it. Attached is a patch which updates > comments about the tablespace/database issue. Applied. -- Bruce Momjian <bruce@momjian.us> http://momjian.us EnterpriseDB http://enterprisedb.com + Everyone has their own god. +