Re: pg_index question

From: Scott Marlowe <smarlowe(at)g2switchworks(dot)com>
To: Terry Lee Tucker <terry(at)esc1(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: pg_index question
Date: 2005-03-25 21:52:36
Message-ID: 1111787556.12450.14.camel@state.g2switchworks.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, 2005-03-25 at 15:10, Terry Lee Tucker wrote:
> Hi,
>
> If I were to set the value of pg_class.indisunique on a unique index to False
> inside a transaction so I could juggle sequence numbers around on a table
> with a unique two element index, and then set it back again to its proper
> value, all in the same transaction, would that allow me to temorarily
> override the unique index behavior? Is it safe to temporarily change the
> value of that column?

You could, but, in order to ensure there are no duplicates, you'd have
to check after turning it back on to see if there were and delete them
by some logic that made sense for your transactional methodologies.

I wouldn't recommend it really, because I'm willing to bet there are
race conditions I'm not thinking of that could bite you in the behind.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2005-03-25 21:53:07 Re: pg_index question
Previous Message Terry Lee Tucker 2005-03-25 21:30:31 Re: pg_index question