BUG #13632: violation de l'intégrité référentielle

Поиск
Список
Период
Сортировка
От allhassane@yahoo.fr
Тема BUG #13632: violation de l'intégrité référentielle
Дата
Msg-id 20150922134404.5050.75087@wrigleys.postgresql.org
обсуждение исходный текст
Ответы Re: [BUGS] BUG #13632: violation de l'intégrité référentielle  ("David G. Johnston" <david.g.johnston@gmail.com>)
Re: [BUGS] BUG #13632: violation de l'intégrité référentielle  (Thomas Munro <thomas.munro@enterprisedb.com>)
Список pgsql-bugs
The following bug has been logged on the website:

Bug reference:      13632
Logged by:          Alassane Diakité
Email address:      allhassane@yahoo.fr
PostgreSQL version: 9.4.4
Operating system:   windows
Description:

Salut
La situation...
Les tables tm et tf (tf liée à tm par une intégrité référentielle)
[code]create table tm(idm serial not null primary key, vm varchar);
create table tf(idf serial not null primary key, idm int not null references
tm(idm) on delete cascade, vf varchar);[/code]
Un fonction trigger qui annule la suppression dans tf
[code]
--le trigger
create function tgtf() returns trigger
as
$$
begin
return null;
end
$$ language plpgsql

--liaison à tf
create trigger tgf before delete on tf
 FOR EACH ROW
  EXECUTE PROCEDURE tgtf();
[/code]
insertion de données dans tm et tf
[code]insert into tm(vm) values('a'),('b'),('c');
insert into tf(idm, vf) values(1, 'a1'),(1, 'a2'), (2, 'b1'), (2, 'b2'),(3,
'c1'),(3, 'c2');[/code]
suppression d'une ligne de tm
[code]delete from tm where idm=1;[/code]
la jointure gauche
[code]select tf.idm, tf.vf, tm.idm from tf left join tm on
tf.idm=tm.idm;[/code]
idm      vf    idm
1        a1     null
1        a2     null
2        b1     2
2        b2     2
3        c1     3
3        c2     3

Qu'en dites-vous?
J'avais une fois remarqué qu'une des mes bd présentait ce problème
(violation d'intégrité référentielle) sans que je ne sache comment c'est
arrivé. Maintenant que j'ai reproduit la situation, je veux comprendre le
problème.
@+



В списке pgsql-bugs по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #13631: Missing "'" in Table 9-26. to_char Examples
Следующее
От: andreas-postgresql@creative-memory.de
Дата:
Сообщение: BUG #13633: ERROR: invalid memory alloc request size