pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Simon Kinsella <simon@bluefiresystems.co.uk>
To: pgsql-sql@postgresql.org
Subject: Possible to emulate pre-8.2 behaviour of SET CONSTRAINTS?
Date: Sun, 21 Jan 2007 23:52:28 -0000
Message-ID: <20070121235235.BADE3197346@smtp06l.fasthosts.co.uk> (raw)

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.





view thread (3+ messages)  latest in thread

Message-ID: <20070121235235.BADE3197346@smtp06l.fasthosts.co.uk>
Permalink:  ../20070121235235.BADE3197346@smtp06l.fasthosts.co.uk/
Also on:    postgresql.org/message-id/20070121235235.BADE3197346@smtp06l.fasthosts.co.uk

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: simon@bluefiresystems.co.uk
  Subject: Re: Possible to emulate pre-8.2 behaviour of SET CONSTRAINTS?
  In-Reply-To: <20070121235235.BADE3197346@smtp06l.fasthosts.co.uk>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox