Обсуждение: Problem: Referential Integrity Constraints lost

Поиск
Список
Период
Сортировка

Problem: Referential Integrity Constraints lost

От
Achilleus Mantzios
Дата:
Hi i think a hit a major problem on 7.2.1.
I run 3 systems with postgresql 7.2.1.
Its a redhat 7.1 for development, a redhat 7.3 for production
and a FreeBSD 4.6.1RC2 for testing.

After long runs (with periodic (daily) vacuum analyze's)
i noticed that some of the triggers that implement referential integrity
constraints just disapeared.
Some of these triggers were still present on the FreeBSD system
(which has been idle for a month or so), whereas on the linux
systems they were absent.

Has any one have a clue??
Any comment would be really valuable at this moment of darkness.

Thanx.

==================================================================
Achilleus Mantzios
S/W Engineer
IT dept
Dynacom Tankers Mngmt
Nikis 4, Glyfada
Athens 16610
Greece
tel:    +30-10-8981112
fax:    +30-10-8981877
email:  achill@matrix.gatewaynet.com
        mantzios@softlab.ece.ntua.gr


Re: [SQL] Problem: Referential Integrity Constraints lost

От
Achilleus Mantzios
Дата:
Also i must that these lost triggers implement the parent table
side of the constraint, e.g.

CREATE TABLE VslSections(
id serial NOT NULL UNIQUE PRIMARY KEY,
name varchar(20) NOT NULL UNIQUE);

CREATE TABLE MachClasses(
id serial NOT NULL UNIQUE PRIMARY KEY,
name varchar(20) NOT NULL UNIQUE,
vslsecid int4 NOT NULL,
FOREIGN KEY (vslsecid) REFERENCES VslSections (id));

Then the triggers created are :

1)
CREATE CONSTRAINT TRIGGER "<unnamed>" AFTER INSERT OR UPDATE ON
"machclasses"  FROM "vslsections" NOT DEFERRABLE INITIALLY IMMEDIATE FOR
EACH ROW EXECUTE PROCEDURE "RI_FKey_check_ins" ('<unnamed>',
'machclasses', 'vslsections', 'UNSPECIFIED', 'vslsecid', 'id');
2)
CREATE CONSTRAINT TRIGGER "<unnamed>" AFTER DELETE ON "vslsections"  FROM
"machclasses" NOT DEFERRABLE INITIALLY IMMEDIATE FOR EACH ROW EXECUTE
PROCEDURE "RI_FKey_noaction_del" ('<unnamed>', 'machclasses',
'vslsections', 'UNSPECIFIED', 'vslsecid', 'id');
3)
CREATE CONSTRAINT TRIGGER "<unnamed>" AFTER UPDATE ON "vslsections"  FROM
"machclasses" NOT DEFERRABLE INITIALLY IMMEDIATE FOR EACH ROW EXECUTE
PROCEDURE "RI_FKey_noaction_upd" ('<unnamed>', 'machclasses',
'vslsections', 'UNSPECIFIED', 'vslsecid', 'id');

The *LOST* triggers are 2 and 3.

==================================================================
Achilleus Mantzios
S/W Engineer
IT dept
Dynacom Tankers Mngmt
Nikis 4, Glyfada
Athens 16610
Greece
tel:    +30-10-8981112
fax:    +30-10-8981877
email:  achill@matrix.gatewaynet.com
        mantzios@softlab.ece.ntua.gr