RNG <rgasch@xxxxxxxxx> writes: > Trying to insert data into this table using the following SQL > ... > gives us the following error: > ERROR: duplicate key violates unique constraint "pn_categories_category_pkey" Usually the reason for this is that you inserted some rows with manually assigned serial numbers (perhaps a COPY from an old version of the table?) and forgot to advance the sequence past those numbers. Try something like SELECT setval('pn_categories_category_cat_id_seq', (SELECT MAX(cat_id) + 1 FROM pn_categories_category)); regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to majordomo@xxxxxxxxxxxxxx so that your message can get through to the mailing list cleanly