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 8F7E7D1B55C for ; Sat, 31 Jan 2004 23:41:02 +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 12421-01 for ; Sat, 31 Jan 2004 19:40:57 -0400 (AST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id BAD2BD1B4BE for ; Sat, 31 Jan 2004 19:40:54 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.11/8.12.11) with ESMTP id i0VNemtg009149; Sat, 31 Jan 2004 18:40:48 -0500 (EST) To: Stephan Szabo Cc: Enio Schutt Junior , pgsql-sql@postgresql.org Subject: Re: Sometimes referential integrity seems not to work In-reply-to: <20040131124500.H98710@megazone.bigpanda.com> References: <20040126175147.B3BD046E09@mail.passofundo.rs.gov.br> <20040131124500.H98710@megazone.bigpanda.com> Comments: In-reply-to Stephan Szabo message dated "Sat, 31 Jan 2004 12:45:43 -0800" Date: Sat, 31 Jan 2004 18:40:48 -0500 Message-ID: <9148.1075592448@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200401/298 X-Sequence-Number: 16691 Stephan Szabo writes: > 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". >> ... >> can the postgres user delete records despite referential integrity? > It shouldn't. Can you give your version information and a complete > standalone example? I think the first PG release or two that had TRUNCATE TABLE would allow you to apply it despite the existence of foreign-key constraints on the table. Recent releases won't though. regards, tom lane