Re: most idiomatic way to "update or insert"?

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: most idiomatic way to "update or insert"?
Дата
Msg-id 878ycujr0g.fsf@stark.xeocode.com
обсуждение исходный текст
Ответ на Re: most idiomatic way to "update or insert"?  ("Peter Darley" <pdarley@kinesis-cem.com>)
Список pgsql-general
I'll mention that often I do exactly what you're doing. I find deleting all
existing records and then inserting what I want to appear to be cleaner than
handling the various cases that can arise if you don't.

This happens most often when I have a list of items and have a UI that allows
the user to edit the entire list and commit a whole new list in one action.
It's much easier to simply delete the old list and insert the entire new list
in a single query than to try to figure out which rows to delete and which to
insert.

--
greg

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

Предыдущее
От: Steve Crawford
Дата:
Сообщение: Re: query result set caching
Следующее
От: Lincoln Yeoh
Дата:
Сообщение: Re: most idiomatic way to "update or insert"?