Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Sql > Re: numbering r...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 4 Topic 3448 of 3717
Post > Topic >>

Re: numbering rows on im****t from file

by chestercyoung@[EMAIL PROTECTED] (chester c young) May 2, 2008 at 03:33 PM

--- Alexy Khrabrov <deliverable@[EMAIL PROTECTED]
> wrote:

> Now I want to number the rows, adding an id column 
> as an autoincrement from a sequence.  How should I do the im****t now 
> for the sequence to work -- should I add the id column last, so it  
> will not be filled by copy and presumably autoincrement?

use a sequence
restart sequence to 1 before copy
have column id default to nextval('seq')

when doing copy don't have a column matching your id (duh)



     
____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now. 
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ

-- 
Sent via pgsql-sql mailing list (pgsql-sql@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql
 




 4 Posts in Topic:
numbering rows on import from file
deliverable@[EMAIL PROTEC  2008-05-02 14:26:34 
Re: numbering rows on import from file
chestercyoung@[EMAIL PROT  2008-05-02 15:33:39 
Re: numbering rows on import from file
scott.marlowe@[EMAIL PROT  2008-05-02 17:00:33 
Re: numbering rows on import from file
scrawford@[EMAIL PROTECTE  2008-05-02 17:18:27 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Oct 12 21:08:51 CDT 2008.