X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 9D5D6D1DA9D for ; Sat, 31 Jan 2004 20:45:44 +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 51418-04 for ; Sat, 31 Jan 2004 16:45:44 -0400 (AST) Received: from megazone.bigpanda.com (megazone.bigpanda.com [64.147.171.210]) by svr1.postgresql.org (Postfix) with ESMTP id 122DFD1DA97 for ; Sat, 31 Jan 2004 16:45:43 -0400 (AST) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id 36E403532D; Sat, 31 Jan 2004 12:45:44 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id 0DB6735324; Sat, 31 Jan 2004 12:45:44 -0800 (PST) Date: Sat, 31 Jan 2004 12:45:43 -0800 (PST) From: Stephan Szabo To: Enio Schutt Junior Cc: pgsql-sql@postgresql.org Subject: Re: Sometimes referential integrity seems not to work In-Reply-To: <20040126175147.B3BD046E09@mail.passofundo.rs.gov.br> Message-ID: <20040131124500.H98710@megazone.bigpanda.com> References: <20040126175147.B3BD046E09@mail.passofundo.rs.gov.br> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200401/297 X-Sequence-Number: 16690 On Mon, 26 Jan 2004, Enio Schutt Junior wrote: > 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? It shouldn't. Can you give your version information and a complete standalone example?