Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id D0F371337B58 for ; Mon, 22 Nov 2010 10:58:28 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 37463-06 for ; Mon, 22 Nov 2010 14:58:22 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from gw.wicourts.gov (gwmta.wicourts.gov [165.219.244.99]) by mail.postgresql.org (Postfix) with ESMTP id 5922C1336FA7 for ; Mon, 22 Nov 2010 10:58:21 -0400 (AST) Received: from Courts-MTA by gw.wicourts.gov with Novell_GroupWise; Mon, 22 Nov 2010 08:58:18 -0600 Message-Id: <4CEA30A90200002500037CE1@gw.wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 8.0.1 Date: Mon, 22 Nov 2010 08:58:17 -0600 From: "Kevin Grittner" To: "Achilleas Mantzios" , Subject: Re: FK disappeared in 8.3.3 References: <201011221213.32035.achill@matrix.gatewaynet.com> In-Reply-To: <201011221213.32035.achill@matrix.gatewaynet.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-4.21 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201011/185 X-Sequence-Number: 36151 Achilleas Mantzios wrote: > One (ON DELETE CASCADE) FK constraint which was supposed to be > there was found to be (mysteriously) absent. Do you have old backups to see how long it has been gone? > So we pg_dumped the schema on a known good 8.3.3 identical test > database That's an oxymoron. 8.3.3 has known bugs and security vulnerability which have been fixed in maintenance releases which can be applied without a dump and reload. http://www.postgresql.org/support/versioning The current 8.3 release is 8.3.12. For details of what's been fixed, see this: http://www.postgresql.org/docs/8.3/static/release.html > and compared it against the suspicious schema on the problematic > vessel. The diff (without options) alone produced ~ 7500 lines of > output. Were both databases at the same version number? Was the same version of pg_dump used for both dumps? (Note: you can always dump an older database with a newer version of pg_dump, but not vice versa.) > Both databases were created with the same procedure using dumps > from 7.4.2. The current version of 7.4 is 7.4.30!: http://www.postgresql.org/docs/7.4/static/release.html I'm not clear what you mean, though. Both databases are on 8.3.3? > I must mention that the HW of the problematic vessel died some > time around summer, and i had myself personally onboard, pg_dump > the old DB, and restore it to the new box. Did you get any errors when the dump was loaded? A damaged database might have left orphaned rows which would have prevented creation of the foreign key. Do you still have a dump file from that point? > I am puzzled about the differences in the schema, if any one has > any ideas of why this might be happening, would be great. My first guess is that they were dumped by pg_dump executables from different versions. -Kevin