pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: maxim.boguk@gmail.com
To: pgsql-bugs@postgresql.org
Subject: BUG #8408: Not exactly correct error messages for failed check in presence of dropped columns.
Date: Fri, 30 Aug 2013 05:13:41 +0000
Message-ID: <E1VFH1h-0002tY-Nt@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

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



view thread (3+ messages)  latest in thread

Message-ID: <E1VFH1h-0002tY-Nt@wrigleys.postgresql.org>
Permalink:  ../E1VFH1h-0002tY-Nt@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/E1VFH1h-0002tY-Nt@wrigleys.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: maxim.boguk@gmail.com
  Subject: Re: BUG #8408: Not exactly correct error messages for failed check in presence of dropped columns.
  In-Reply-To: <E1VFH1h-0002tY-Nt@wrigleys.postgresql.org>
  References: <E1VFH1h-0002tY-Nt@wrigleys.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox