Re: Proposal: move column defaults into pg_attribute along with attacl - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Proposal: move column defaults into pg_attribute along with attacl
Date
Msg-id 29547.1222020118@sss.pgh.pa.us
Whole thread Raw
In response to Re: Proposal: move column defaults into pg_attribute along with attacl  ("Joshua D. Drake" <jd@commandprompt.com>)
Responses Re: Proposal: move column defaults into pg_attribute along with attacl  (dpage@pgadmin.org)
Re: Proposal: move column defaults into pg_attribute along with attacl  (Stephen Frost <sfrost@snowman.net>)
Re: Proposal: move column defaults into pg_attribute along with attacl  (Markus Wanner <markus@bluegap.ch>)
List pgsql-hackers
"Joshua D. Drake" <jd@commandprompt.com> writes:
> Tom Lane wrote:
>> A possible objection to this plan is that if the column-level privileges
>> patch doesn't get in, then we're left with a useless column in
>> pg_attribute.  But an always-null column doesn't cost much of anything,
>> and we know that sooner or later we will support per-column ACLs:
>> they are clearly useful as well as required by spec.  So any
>> inefficiency would only be transient anyway.

> Right. I don't see this objection holding much water as column privs are 
> something that many in the community would like to see. If Stephen's 
> patch doesn't get in, it is likely it would (or a derivative there of) 
> within the 8.5 release cycle. If anything it just provides a stepping 
> stone. I see nothing wrong with that.

Yah.  However, I started to look at doing this and immediately hit a
stumbling block: we need a representation in pg_depend for a column's
default expression (as distinct from the column itself).  Currently
this consists of classid = OID of pg_attrdef, objid = OID of the
default's row in pg_attrdef; both of which would disappear if we
get rid of pg_attrdef as an actual catalog.

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?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Joe Conway
Date:
Subject: Re: [patch] fix dblink security hole
Next
From: dpage@pgadmin.org
Date:
Subject: Re: Proposal: move column defaults into pg_attribute along with attacl