newbie primary key problem

From: "Dan" <dan(at)NOSPAMbluecap(dot)co(dot)uk>
To: pgsql-general(at)postgresql(dot)org
Subject: newbie primary key problem
Date: 2001-06-12 16:33:02
Message-ID: 992363662.6879.0.nnrp-08.d4f07c93@news.demon.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

I have a small php script to log web access that writes to a psql database.
The error I get everytime I do a refresh is:
Warning: PostgreSQL query failed: ERROR: Cannot insert a duplicate key into
unique index session_pkey in /var/www/php/web.php on line 22

As I understand it the session ID it adds is a primary key and therefore
cannot be duplicated.
Can I create another collumn that auto increments a number ( starting with 1
will be fine ) that can be the primary key/index?
Firstly is this the best way to do it, also can anyone point me to any
webpages with rough newbie instructions on this?

Thank you

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Fred J 2001-06-12 16:36:54 Re: problem with me or postgres ?
Previous Message Martín Marqués 2001-06-12 16:07:48 Re: Which of latest version is stable ?