Re: changing multiple pk's in one update - Mailing list pgsql-sql

From Scott Marlowe
Subject Re: changing multiple pk's in one update
Date
Msg-id dcc563d10904101120y49f00977nc74132e982518444@mail.gmail.com
Whole thread Raw
In response to changing multiple pk's in one update  (Stuart McGraw <smcg2297@frii.com>)
Responses Re: changing multiple pk's in one update
Re: changing multiple pk's in one update
List pgsql-sql
2009/4/7 Stuart McGraw <smcg2297@frii.com>:
> Hello all,
>
> I have a table with a primary key column
> that contains sequential numbers.
>
> Sometimes I need to shift them all up or down
> by a fixed amount.  For example, if I have
> four rows with primary keys, 2, 3, 4, 5, I
> might want to shift them down by 1 by doing:
>

Generally speaking, when you need to do this more than once or twice
in the lifetime of your data, there's something wrong with your data
model.


pgsql-sql by date:

Previous
From: Jasen Betts
Date:
Subject: Re: How would I get rid of trailing blank line?
Next
From: Jasen Betts
Date:
Subject: Re: SQL to Check whether "AN HOUR PERIOD" is between start and end timestamps