Re: RelFileNode to Relation

From: Soroosh Sardari <soroosh(dot)sardari(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: RelFileNode to Relation
Date: 2013-10-19 08:39:29
Message-ID: CAFUsPDYKcYwqYMMfDp=zsBtMZjCWXNSkVWWAJygcF-R_vksHpA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Oct 19, 2013 at 11:53 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Soroosh Sardari <soroosh(dot)sardari(at)gmail(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Dean Rasheed 2013-10-19 08:48:50 Re: Updatable view columns
Previous Message Tom Lane 2013-10-19 08:23:57 Re: RelFileNode to Relation