RE: [SQL] filling an empty table w/ defaults defined

Поиск
Список
Период
Сортировка
От Jackson, DeJuan
Тема RE: [SQL] filling an empty table w/ defaults defined
Дата
Msg-id D05EF808F2DFD211AE4A00105AA1B5D20DCC2B@cpsmail
обсуждение исходный текст
Список pgsql-sql
The problem is that the datetime entry is generating the same time values in
the transaction.  You do not want that as your primary key.  You can still
create an index on the value, but if two (or more) rows are ever inserted in
the same transaction or even at the exact same time your primary key will be
invalid.
If you can't recreate the table with another primary key the just drop the
index.  You can create a new index with the CREATE INDEX statement.

> Is there a way to "turn off" a field (insertdt datetime primary key
> default 
> text 'now') as I populate a table?  I have a populated table, and a mirror
> 
> image of its structure except with the field shown above added.  I'd like 
> to insert data into the new table from the old, but postgres is telling me
> 
> it cannot insert a duplicate key into a unique index - I figure it is 
> trying to use the same date/time value for 'now'.  is there any other way?
> 
> jt
> 


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

Предыдущее
От: JT Kirkpatrick
Дата:
Сообщение: incrementing by the second
Следующее
От: "Jackson, DeJuan"
Дата:
Сообщение: RE: [SQL] incrementing by the second