need more ALTER TABLE guards for typed tables

Started by Peter Eisentrautover 15 years ago3 messageshackers
Jump to latest
#1Peter Eisentraut
peter_e@gmx.net

After some investigation I figured that I need to add two more checks
into the ALTER TABLE code to prevent certain types of direct changes to
typed tables (see attached patch).

But it's not clear to me whether such checks should go into the "Prep"
or the "Exec" phases. Prep seems more plausible to me, but some
commands such as DropColumn don't have a Prep handler. A clarification
would be helpful.

Attachments:

dont-alter-typed-tables.patchtext/x-patch; charset=UTF-8; name=dont-alter-typed-tables.patchDownload+10-0
#2Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Peter Eisentraut (#1)
Re: need more ALTER TABLE guards for typed tables

Excerpts from Peter Eisentraut's message of mié jul 21 15:18:58 -0400 2010:

After some investigation I figured that I need to add two more checks
into the ALTER TABLE code to prevent certain types of direct changes to
typed tables (see attached patch).

But it's not clear to me whether such checks should go into the "Prep"
or the "Exec" phases. Prep seems more plausible to me, but some
commands such as DropColumn don't have a Prep handler. A clarification
would be helpful.

I think if there's no Prep phase, you should add it. I don't think it
makes sense to have this kind of check in Exec.

#3Peter Eisentraut
peter_e@gmx.net
In reply to: Alvaro Herrera (#2)
Re: need more ALTER TABLE guards for typed tables

On ons, 2010-07-21 at 15:48 -0400, Alvaro Herrera wrote:

Excerpts from Peter Eisentraut's message of mié jul 21 15:18:58 -0400 2010:

After some investigation I figured that I need to add two more checks
into the ALTER TABLE code to prevent certain types of direct changes to
typed tables (see attached patch).

But it's not clear to me whether such checks should go into the "Prep"
or the "Exec" phases. Prep seems more plausible to me, but some
commands such as DropColumn don't have a Prep handler. A clarification
would be helpful.

I think if there's no Prep phase, you should add it. I don't think it
makes sense to have this kind of check in Exec.

OK, here is my patch for this. (should go into 9.0 and 9.1)

Attachments:

dont-alter-typed-tables.patchtext/x-patch; charset=UTF-8; name=dont-alter-typed-tables.patchDownload+56-16