Skip site navigation (1) Skip section navigation (2)

Re: Adding Missing Data to a Table

From: Dan Colish <dan(at)unencrypted(dot)org>
To: pdxpug(at)postgresql(dot)org
Subject: Re: Adding Missing Data to a Table
Date: 2011-03-29 21:22:58
Message-ID: 7D564C35CACC4AA491B987F829D6E602@unencrypted.org (view raw or flat)
Thread:
Lists: pdxpug
On Tuesday, March 29, 2011 at 2:10 PM, Rich Shepard wrote:
On Tue, 29 Mar 2011, Dan Colish wrote:
> 
> > want to use a sequence and initialize it above the existing id's.
> 
> Dan,
> 
>  Exactly. Is the procedure for doing this in one of the postgres manuals? I
> am unaware of how to retroactively apply a sequence to a column that is
> one-quarter filled.
> 
> Thank you,
> 
> Rich
> 
> -- 
> Sent via pdxpug mailing list (pdxpug(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pdxpug
> 
Well there are good docs for setting up a sequence. As for setting it up on your table, I believe an ALTER COLUMN using the sequence nextval as default should do it. Best to test this one out before doing it for real.

Here are the docs for sequence: http://www.postgresql.org/docs/current/static/sql-createsequence.html

--Dan 

In response to

Responses

pdxpug by date

Next:From: Darrell FuhrimanDate: 2011-03-29 22:06:07
Subject: Re: Adding Missing Data to a Table
Previous:From: wesDate: 2011-03-29 21:16:53
Subject: Re: Adding Missing Data to a Table

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group