Re: Bug in ALTER COLUMN SET DATA TYPE ?
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Pavan Deolasee <pavan.deolasee@gmail.com>
Cc: Nikhil Sontakke <nikkhils@gmail.com>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2012-11-04T23:11:03Z
Lists: pgsql-hackers
Pavan Deolasee <pavan.deolasee@gmail.com> writes: > On Sat, Nov 3, 2012 at 10:21 AM, Nikhil Sontakke <nikkhils@gmail.com> wrote: >>>> So coming back to the issue, do you think it's a good idea to teach >>>> ATAddCheckConstraint() that the call is coming from a late phase of ALTER >>>> TABLE ? >>> +1 >> You mentioned AT_PASS_OLD_INDEX in your original mail, but I guess that >> you meant that we should check for AT_PASS_OLD_CONSTR and then not raise >> an error? > Yeah, I meant AT_PASS_OLD_CONSTR. It's clear that we need to pass down the information that this action is coming from re-creation of a check constraint, but I think the above proposal for how to do it is pretty wrong-headed. The pass structure has never meant anything for semantics of individual AlterTable actions; it's only used to make sure those actions are done in an appropriate order. Furthermore, the pass number isn't available where it would be needed --- you'd have to pass it down through several levels of subroutine that don't have another reason to care about it. I'm inclined to think the cleanest solution is to add another value of enum AlterTableType, perhaps "AT_ReAddConstraint", to signal that we're executing a re-add; and then add another bool parameter to ATExecAddConstraint to tell the latter not to complain if child tables exist. This is more in line with pre-existing coding choices such as the use of AT_AddConstraintRecurse. regards, tom lane
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Recast "ONLY" column CHECK constraints as NO INHERIT
- 09ff76fcdb27 9.2.0 cited
-
Adjust join_search_one_level's handling of clauseless joins.
- 1f0363001166 9.2.0 cited
-
Allow CHECK constraints to be declared ONLY
- 61d81bd28dbe 9.2.0 cited
-
Change the rules for inherited CHECK constraints to be essentially the same
- cd902b331dc4 8.4.0 cited