pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: jan.kort@genetics.nl
To: pgsql-bugs@postgresql.org
Subject: BUG #14025: Unable to validate constraints
Date: Wed, 16 Mar 2016 15:08:11 +0000
Message-ID: <20160316150811.5173.29176@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:      14025
Logged by:          Jan
Email address:      jan.kort@genetics.nl
PostgreSQL version: 9.4.1
Operating system:   Windows 2012 Server
Description:        

When I do:
- disable trigger all
- incorrect foreign key reference
- enable trigger all
- validate
Then I get no error, I was expecting an error.

For example:

-- This succeeds (expected)
drop table if exists test1;
drop table if exists test2;
create table test2 (id int primary key);
create table test1 (id int primary key, test2_id int references test2(id));
insert into test2 (id) values (1);
insert into test1 (id, test2_id) values (1, 1);

-- This fails (expected)
drop table if exists test1;
drop table if exists test2;
create table test2 (id int primary key);
create table test1 (id int primary key, test2_id int references test2(id));
alter table test1 disable trigger user;
insert into test1 (id, test2_id) values (1, 1);
alter table test1 enable trigger user;

-- This succeeds (unexpected)
drop table if exists test1;
drop table if exists test2;
create table test2 (id int primary key);
create table test1 (id int primary key, test2_id int references test2(id));
alter table test1 disable trigger all;
insert into test1 (id, test2_id) values (1, 1);
alter table test1 enable trigger all;
alter table test1 validate constraint test1_test2_id_fkey;

Regards,

Jan




-- 
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: <20160316150811.5173.29176@wrigleys.postgresql.org>
Permalink:  ../20160316150811.5173.29176@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/20160316150811.5173.29176@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: jan.kort@genetics.nl
  Subject: Re: BUG #14025: Unable to validate constraints
  In-Reply-To: <20160316150811.5173.29176@wrigleys.postgresql.org>
  References: <20160316150811.5173.29176@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