Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 4F4F19FB57F for ; Sun, 21 Jan 2007 20:09:25 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-new, port 10024) with ESMTP id 03657-06 for ; Sun, 21 Jan 2007 20:09:18 -0400 (AST) X-Greylist: delayed 00:16:42.680482 by SQLgrey-1.7.4 Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id 53A7E9FB562 for ; Sun, 21 Jan 2007 20:09:22 -0400 (AST) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 Received: from smtp06l.fasthosts.co.uk (smtp.fasthosts.co.uk [213.171.216.50]) by svr4.postgresql.org (Postfix) with ESMTP id BE2FC5AFA00 for ; Sun, 21 Jan 2007 23:52:38 +0000 (GMT) Received: from aurora (213-78-152-15.ppp.onetel.net.uk [213.78.152.15]) by smtp06l.fasthosts.co.uk (Postfix) with ESMTP id BADE3197346 for ; Sun, 21 Jan 2007 23:52:35 +0000 (GMT) From: "Simon Kinsella" To: Subject: Possible to emulate pre-8.2 behaviour of SET CONSTRAINTS? Date: Sun, 21 Jan 2007 23:52:28 -0000 Organization: Bluefire Systems Ltd MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook, Build 11.0.5510 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 Thread-Index: Acc9tk/3JpSnLRJQSgivbRFc9knkwQAAOMXA Message-Id: <20070121235235.BADE3197346@smtp06l.fasthosts.co.uk> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=BAYES_50 X-Spam-Level: X-Archive-Number: 200701/94 X-Sequence-Number: 27246 Hi My system currently runs on PostgreSQL 8.1 and makes use of the old behaviour of SET CONSTRAINTS, namely that the command is applied to all constraints that match the specified name. This makes it very easy to write a general-case function that can change the DEFERRED mode on a given constraint that is present in several similar schemas (sounds odd maybe but it works very well in my case!). I understand that SET CONSTRAINTS in 8.2 no longer behaves like this. It's looking like my general function will need to do something like: SET CONSTRAINTS schema1.foo IMMEDIATE; SET CONSTRAINTS schema2.foo IMMEDIATE; SET CONSTRAINTS schema3.foo IMMEDIATE; ... SET CONSTRAINTS schemaX.foo IMMEDIATE; instead of SET CONSTRAINTS foo IMMEDIATE; and hope that I remember to add new clauses to this function when new schemas are added in the future. Or can I do something with pg_contraints, or some other technique? I'm relunctant to use SET CONSTRAINTS' 'ALL' clause in case it messes with other constraints in the system. Hope this makes sense, Simon --- Simon Kinsella Technical Director - Bluefire Systems Ltd This message has been scanned for viruses.