Re: Auto-increment and data importing: problem pointed out in PHP builder review?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Auto-increment and data importing: problem pointed out in PHP builder review?
Дата
Msg-id 14694.963283578@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Auto-increment and data importing: problem pointed out in PHP builder review?  ("Randall Parker" <randall@nls.net>)
Список pgsql-general
"Randall Parker" <randall@nls.net> writes:
> In particular, on his second complaint about the import and
> auto_increment: via what manner can one import a bunch of records and
> then not have the auto_increment next value be correct?

I *think* what he's griping about is that a COPY IN doesn't
automagically change the sequence counter to be >= last imported value
for the serial column.

Of course you can set the counter --- pg_dump scripts do so --- but it
doesn't happen automatically.

You could maybe force that to happen with a trigger, but IMHO the next
work that ought to be done on SERIAL is to convert it into a "real"
datatype.  Then stuff like this could be made to happen in the datatype-
specific I/O routines, which seems like a better answer ...

            regards, tom lane

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

Предыдущее
От: Jeff Waugh
Дата:
Сообщение: Re: Slashdot discussion
Следующее
От: Yves Dorfsman
Дата:
Сообщение: Re: importing into postgres from access