newbie primary key problem

Поиск
Список
Период
Сортировка
От Dan
Тема newbie primary key problem
Дата
Msg-id 992363662.6879.0.nnrp-08.d4f07c93@news.demon.co.uk
обсуждение исходный текст
Ответы Re: newbie primary key problem
Список 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




В списке pgsql-general по дате отправления:

Предыдущее
От: "Stephen Howe"
Дата:
Сообщение: Re: Win32 Compilation
Следующее
От: "Enrico Mangano"
Дата:
Сообщение: SET TRANSACTION ISOLATION LEVEL SERIALIZABLE on 7.0