Re: RelFileNode to Relation - Mailing list pgsql-hackers

From Soroosh Sardari
Subject Re: RelFileNode to Relation
Date
Msg-id CAFUsPDYKcYwqYMMfDp=zsBtMZjCWXNSkVWWAJygcF-R_vksHpA@mail.gmail.com
Whole thread Raw
In response to Re: RelFileNode to Relation  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers

On Sat, Oct 19, 2013 at 11:53 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Soroosh Sardari <soroosh.sardari@gmail.com> writes:
> I need to get a Relation instance but I have only a RelFileNode!

Why do you think you need to do that?  Such a lookup is inherently the
wrong thing, because relations' relfilenode values are not fixed (unless
you have a lock on the relation, which presumably you don't).

                        regards, tom lane


I know, it's against PG abstraction.
In PG we don't need to know anything about relation in the smgr level. but in my project i want to encrypt
all pages of a particular relation and decrypt it when those pages are fetching back to buffer.

This behavior depends on some relation properties. So in smgropen I must get some knowledge about the relation and all of i have is RelFileNode.

I can not see the pg_class for the relation oid, because smgropen may called before insertion in pg_class.

Soroosh

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: RelFileNode to Relation
Next
From: Dean Rasheed
Date:
Subject: Re: Updatable view columns