Re: Bug in ALTER COLUMN SET DATA TYPE ?

Pavan Deolasee <pavan.deolasee@gmail.com>

From: Pavan Deolasee <pavan.deolasee@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Nikhil Sontakke <nikkhils@gmail.com>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2012-11-05T09:12:42Z
Lists: pgsql-hackers

Attachments

On Mon, Nov 5, 2012 at 4:41 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

>
>
> 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.


Yeah, I only meant that we need to teach ATExecAddConstraint that its being
called from the specific pass of ALTER TABLE and wanted to get agreement on
that. I hadn't thought about any particular implementation. So your
proposal below looks absolutely fine and clean.


>
> 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.
>

Please see attached patch which does what you suggested above. May be it
needs a little more commentary to record why we made this specific change.
Please let me know if you think so and want me to do that.

Thanks,
Pavan

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Recast "ONLY" column CHECK constraints as NO INHERIT

  2. Adjust join_search_one_level's handling of clauseless joins.

  3. Allow CHECK constraints to be declared ONLY

  4. Change the rules for inherited CHECK constraints to be essentially the same