| От | Mark Harrison |
|---|---|
| Тема | most idiomatic way to "update or insert"? |
| Дата | |
| Msg-id | 4111706B.1060401@pixar.com обсуждение исходный текст |
| Ответы |
Re: most idiomatic way to "update or insert"?
Re: most idiomatic way to "update or insert"? Re: most idiomatic way to "update or insert"? |
| Список | pgsql-general |
So I have some data that I want to put into a table. If the
row already exists (as defined by the primary key), I would
like to update the row. Otherwise, I would like to insert
the row.
I've been doing something like
delete from foo where name = 'xx';
insert into foo values('xx',1,2,...);
but I've been wondering if there's a more idiomatic or canonical
way to do this.
Many TIA,
Mark
--
Mark Harrison
Pixar Animation Studios
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера