pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PFC <lists@boutiquenumerique.com>
To: bernard@bgsoftfactory.com
To: pgsql-sql@postgresql.org
Subject: Re: Newbie wonder...
Date: Mon, 14 Mar 2005 10:02:08 +0100
Message-ID: <opsnmd1uimth1vuj@localhost> (raw)
In-Reply-To: <1mmif8pua8zxb.q7qw4hme6jk5.dlg@40tude.net>
References: <1mmif8pua8zxb.q7qw4hme6jk5.dlg@40tude.net>


	If you want to add a SERIAL field to an existing table, create a sequence  
and then create an integer field with default nextval(seq) and postgres  
will fill it automatically. The order in which it will fill it is not  
guaranteed though !

	However, you might also like to de-dupe your data once it's in the  
additional tables, thus you might need more complicated measures.


> (2) How should I go to create a sequence for an existing table? For all
> futures data entry, after this conversion, I want the unique ID for each
> row to come from a sequence, but if I know how to create a table using
> serial, I am not sure how to modify one for this.
>
> Thanks,
> Bernard
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
>                http://archives.postgresql.org
>





view thread (4+ messages)  latest in thread

Message-ID: <opsnmd1uimth1vuj@localhost>
Permalink:  ../opsnmd1uimth1vuj@localhost/
Also on:    postgresql.org/message-id/opsnmd1uimth1vuj@localhost

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: lists@boutiquenumerique.com, bernard@bgsoftfactory.com
  Subject: Re: Newbie wonder...
  In-Reply-To: <opsnmd1uimth1vuj@localhost>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox