| From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> | 
|---|---|
| To: | Rasmus Resen Amossen <NOSPAM(at)hey(dot)com> | 
| Cc: | pgsql-general(at)postgresql(dot)org | 
| Subject: | Re: Bug? | 
| Date: | 2001-11-15 16:17:22 | 
| Message-ID: | 12664.1005841042@sss.pgh.pa.us | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-general | 
Rasmus Resen Amossen <NOSPAM(at)hey(dot)com> writes:
> I got a table with a "serial" attribute. For example
> CREATE TABLE test (
>   id SERIAL NOT NULL,
>   val INT
> );
> The the following insertions creates an error:
> INSERT INTO test(id,val) VALUES (1,1);
> INSERT INTO test(val) VALUES (1);
> Error:
> Cannot insert a duplicate key into unique index test_id_key
If you're going to assign IDs manually, you might want to set
the sequence generator past those values.  See setval().
regards, tom lane
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Luis Amigo | 2001-11-15 16:20:05 | bug?? on oid2name | 
| Previous Message | Vivek Khera | 2001-11-15 16:04:09 | Re: Modifying check constraints |