[idea] a copied relkind in pg_attribute - Mailing list pgsql-hackers

From KaiGai Kohei
Subject [idea] a copied relkind in pg_attribute
Date
Msg-id 495221F0.7090101@kaigai.gr.jp
Whole thread Raw
Responses Re: [idea] a copied relkind in pg_attribute  ("Jaime Casanova" <jcasanov@systemguards.com.ec>)
List pgsql-hackers
It is an idea to improve the implementation of SE-PostgreSQL.
I need a copied relkind in pg_attribute, to help its decision
making.

When we access on pg_attribute via ALTER TABLE or DML statement
directly, SE-PostgreSQL checks privilleges for the fetched tuples.
If the relation pointed by its attrelid has RELKIND_RELATION,
the fetched tuple is a column, so db_column object class should
be applied. Otherwise, db_tuple object class should be applied,
because it is not a column, like an entity of composite type.

The current implementation need to lookup RELOID system cache to
identify the relkind of the relation, because pg_attribtue does
not have any information about "relkind". However, I also think
it is not an ideal implementation, even if its frequency is enough
small.

So, I have a plan to put a new member named as "attkind" into
pg_attribute to hold a copied value of its "relkind".
It enables to identify the attribute without looking up system
cache, so it is better than current one.
The pg_class.relkind is always unchanged, so it does not have
any problematical point.

Please comment anything, if you have alternative idea or opinions.
If reviewer intend to comment about the point, it can be fixed with
the above way.

Thanks,
-- 
KaiGai Kohei <kaigai@kaigai.gr.jp>


pgsql-hackers by date:

Previous
From: "Fujii Masao"
Date:
Subject: Re: Archiving control (a part of synch rep patches)
Next
From: Simon Riggs
Date:
Subject: Re: Hot standby and b-tree killed items