Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VFH1s-00042H-L0 for pgsql-bugs@arkaria.postgresql.org; Fri, 30 Aug 2013 05:13:52 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VFH1r-0005u6-VU for pgsql-bugs@arkaria.postgresql.org; Fri, 30 Aug 2013 05:13:52 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VFH1r-0005tz-2B for pgsql-bugs@postgresql.org; Fri, 30 Aug 2013 05:13:51 +0000 Received: from mahout.postgresql.org ([2001:4800:7903:4::123]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VFH1o-00044I-Kf for pgsql-bugs@postgresql.org; Fri, 30 Aug 2013 05:13:50 +0000 Received: from [204.145.124.246] (helo=wrigleys.postgresql.org) by mahout.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VFH1n-0000kW-5a for pgsql-bugs@postgresql.org; Fri, 30 Aug 2013 05:13:47 +0000 Received: from www-data by wrigleys.postgresql.org with local (Exim 4.80) (envelope-from ) id 1VFH1h-0002tY-Nt for pgsql-bugs@postgresql.org; Fri, 30 Aug 2013 05:13:41 +0000 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: BUG #8408: Not exactly correct error messages for failed check in presence of dropped columns. To: pgsql-bugs@postgresql.org From: maxim.boguk@gmail.com Message-Id: Date: Fri, 30 Aug 2013 05:13:41 +0000 X-Pg-Spam-Score: -3.5 (---) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org The following bug has been logged on the website: Bug reference: 8408 Logged by: Maxim Boguk Email address: maxim.boguk@gmail.com PostgreSQL version: 9.2.4 Operating system: Any Description: There are simple test case: create table test_columns (id serial primary key, value int check(value<10)); NOTICE: CREATE TABLE will create implicit sequence "test_columns_id_seq" for serial column "test_columns.id" NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "test_columns_pkey" for table "test_columns" CREATE TABLE insert into test_columns(value) values (100); ERROR: new row for relation "test_columns" violates check constraint "test_columns_value_check" DETAIL: Failing row contains (1, 100). --it's ok... --now let drop value column and add new one alter table test_columns drop column value; ALTER TABLE alter table test_columns add column "value" int check (value < 10); ALTER TABLE insert into test_columns(value) values (100); ERROR: new row for relation "test_columns" violates check constraint "test_columns_value_check" DETAIL: Failing row contains (2, null, 100). -- now (2, null, 100) sound weird... And yes I completely understand where this NULL came from and why this happened. However, I think error message should filter dropped column and strange null values (because if a table has a lot dropped column this error message quickly become completely unreadable). Regards, Maksym -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs