X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 4C6F5D1BB72 for ; Mon, 26 Jan 2004 17:02:11 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 43595-07 for ; Mon, 26 Jan 2004 13:01:40 -0400 (AST) Received: from mail.passofundo.rs.gov.br (unknown [200.182.187.131]) by svr1.postgresql.org (Postfix) with ESMTP id DEF1BD1B43F for ; Mon, 26 Jan 2004 13:01:37 -0400 (AST) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.passofundo.rs.gov.br (Postfix) with ESMTP id 17F2D46E1D for ; Mon, 26 Jan 2004 14:51:50 -0300 (BRT) Received: from pmpf.rs.gov.br (localhost.localdomain [127.0.0.1]) by mail.passofundo.rs.gov.br (Postfix) with SMTP id B3BD046E09 for ; Mon, 26 Jan 2004 14:51:47 -0300 (BRT) Date: Mon, 26 Jan 2004 17:51:47 -0000 To: Subject: Sometimes referential integrity seems not to work From: "Enio Schutt Junior" X-Mailer: TWIG 2.6.1 Reply-To: enio@pmpf.rs.gov.br Message-Id: <20040126175147.B3BD046E09@mail.passofundo.rs.gov.br> X-Virus-Scanned: by AMaViS perl-11 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200401/293 X-Sequence-Number: 16686 In a database I am working, I sometimes have to delete all the records in some tables. According to the referential integrity defined in the creation of the tables, postmaster should not delete the records, but it does. I have used the following commands: "delete from table_1" and "truncate table_1". When deleting records individually, referential integrity works (postmaster does not allows deletion of records which are referred by another table). Is there some difference between deleting records individually or at once? Is there any possibility of the user who does this deletion (postgres, normal users) affects the behaviour of referential integrity in the tables? That is, can the postgres user delete records despite referential integrity? Thanks.