Re: maintaining sequences - Mailing list pgsql-general

From Jeff Eckermann
Subject Re: maintaining sequences
Date
Msg-id 030301c13c9d$62befba0$279c10ac@INTERNAL
Whole thread Raw
In response to Re: maintaining sequences  (Shaun Thomas <sthomas@townnews.com>)
List pgsql-general
You can just reset the next-available value with "select setval
('sequencename', newvalue);"

----- Original Message -----
From: "Shaun Thomas" <sthomas@townnews.com>
To: <roypgsqlgen@xemaps.com>
Cc: <pgsql-general@postgresql.org>
Sent: Thursday, September 13, 2001 2:49 PM
Subject: Re: [GENERAL] maintaining sequences


> On Thu, 13 Sep 2001 roypgsqlgen@xemaps.com wrote:
>
> > Or I guess I'm asking if I can add a default sequence into a column
> > after I've created the table and added data to it?
>
> The easiest way to do this is just create your table as normal, do
> your data load (it will ignore the sequence if you're manually setting
> the identity columns) and then drop and recreate the sequence with
> the starting value you want.
>
> See, easy. ^_^
>
> --
> +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+
> | Shaun M. Thomas                INN Database Programmer              |
> | Phone: (309) 743-0812          Fax  : (309) 743-0830                |
> | Email: sthomas@townnews.com    AIM  : trifthen                      |
> | Web  : hamster.lee.net                                              |
> |                                                                     |
> |     "Most of our lives are about proving something, either to       |
> |      ourselves or to someone else."                                 |
> |                                           -- Anonymous              |
> +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
>
>


pgsql-general by date:

Previous
From: "Mihai Gheorghiu"
Date:
Subject: Sequence value
Next
From: Martín Marqués
Date:
Subject: Re: locale and spanish acute