Re: safely exchanging primary keys?

From: Louis-David Mitterrand <vindex+lists-pgsql-sql(at)apartia(dot)org>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: safely exchanging primary keys?
Date: 2010-05-24 17:00:30
Message-ID: 20100524170030.GB19481@apartia.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Mon, May 24, 2010 at 02:38:39PM +0000, Tim Landscheidt wrote:
> Louis-David Mitterrand <vindex+lists-pgsql-sql(at)apartia(dot)org> wrote:
>
> What does "are not properly updated" mean? Anyhow, why don't

Hi,

I did follow-up on my own post: the problem was elsewhere.

> you use something simple like (untested):
>
> | UPDATE cabin_type
> | SET id_cabin_type =
> | CASE
> | WHEN id_cabin_type = id1 THEN
> | id2
> | ELSE
> | id1
> | END
> | WHERE id_cabin_type IN (id1, id2);

Nice, thanks.

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Louis-David Mitterrand 2010-05-24 17:11:22 Re: safely exchanging primary keys?
Previous Message Tim Landscheidt 2010-05-24 14:38:39 Re: safely exchanging primary keys?