| From: | Michael Simms <grim(at)argh(dot)demon(dot)co(dot)uk> | 
|---|---|
| To: | michael(at)bizsystems(dot)com | 
| Cc: | pgsql-general(at)postgreSQL(dot)org | 
| Subject: | Re: [GENERAL] data type "serial" | 
| Date: | 1999-09-22 23:36:58 | 
| Message-ID: | 199909222336.AAA32395@argh.demon.co.uk | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-general | 
> 
> So how do you store something in data type serial?
> I've created the column but everytime I attempt to do an update I get 
> back the error message that I can't store a duplicate key.
> 
> table_col_seq.last_value = 1
> increment = 1
> maxvalue = 2billion something
> 
> I've tried storing 1,2,some other number in "serial" in the main 
> table to no avail. What is the magic to get this to work. There 
> appears to be no documentation anywhere on the necessary SQL commands 
> to cycle the generator. I've tried the method used for Oracle SQL but 
> that does not work. I'm a bit of a newbie at this.
> 
> Michael
> Michael(at)bizsystems(dot)com
You cant insert into a serial as far as I know.
The serial is simply incrimented automatically whenever a new INSERT is done
on the table.
~Michael (another one)
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Teodor Cimpoesu | 1999-09-23 00:08:25 | Re: [GENERAL] data type "serial" | 
| Previous Message | fk | 1999-09-22 17:59:33 | Re: [SQL] [GENERAL] UPDATE feature or bug? |