Re: Proposal: move column defaults into pg_attribute along with attacl

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Proposal: move column defaults into pg_attribute along with attacl
Date: 2008-09-22 02:07:27
Message-ID: 20080922020727.GC16005@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

* Tom Lane (tgl(at)sss(dot)pgh(dot)pa(dot)us) wrote:
> I can think of a way around that: represent a default expression using
> classid = OID of pg_attribute, objid = OID of table, objsubid = column
> attnum. This is distinct from the column itself, which is represented
> with classid = OID of pg_class. It seems pretty ugly and potentially
> confusing though. Also there would be a compatibility issue for clients
> that examine pg_depend. Is it ugly enough to scuttle the whole concept
> of merging pg_attrdef into pg_attribute?

Being able to handle a setup like that (though in pg_shdepend) might be
necessary anyway, depending on the approach we're happiest with for
column-level acl dependencies. Right now I've avoided it by just going
through all of the columns and the table level grantors/grantees and
listing them all when updating the dependencies. That keeps the
dependency system simple but complicates other things for it. I posed a
question previously about how people felt and don't recall there being
any response as yet.

Certainly, if we move to objid=table OID, objsubid=column attnum in
pg_shdepend, it strikes me that we should do the same in pg_depend where
appropriate, otherwise it'll just be a confusing inconsistancy.

Honestly, I really disliked the code which assumed pg_attribute had no
NULLable/toastable columns and used what seemed like pretty gruesome
hacks to create pg_attribute structures. I'd also really like to get
away from things which approached pg_attribute in that way, such as
pg_attrdef. If we were to accept the pg_attrdef approach, why aren't we
doing a pg_attracl table instead of adding a column to pg_attribute?

Thanks,

Stephen

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2008-09-22 02:14:51 Re: Proposal: move column defaults into pg_attribute along with attacl
Previous Message Tom Lane 2008-09-22 02:00:01 Re: [patch] fix dblink security hole