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: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2012-11-02T14:41:14Z
Lists: pgsql-hackers
Pavan Deolasee <pavan.deolasee@gmail.com> writes:
> I noticed this behavior on master and it seems like a bug to me:

> postgres=# CREATE TABLE test (a float check (a > 10.2));
> CREATE TABLE
> postgres=# CREATE TABLE test_child() INHERITS(test);
> CREATE TABLE
> postgres=# ALTER TABLE test ALTER COLUMN a SET DATA TYPE numeric;
> ERROR:  constraint must be added to child tables too

Interestingly, this works in 8.3 and earlier ... but it fails as
described in all later versions.  So we broke it quite some time back.
It would be good to identify exactly what change broke it.

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