insert/update

Поиск
Список
Период
Сортировка
От Tom Allison
Тема insert/update
Дата
Msg-id 40B4774D.5040701@tacocat.net
обсуждение исходный текст
Ответы Re: insert/update  (Paul Thomas <paul@tmsl.demon.co.uk>)
Re: insert/update  (Jeff Eckermann <jeff_eckermann@yahoo.com>)
Список pgsql-general
I seemed to remember being able to do this but I can't find the docs.

Can I run a sql query to insert new or update existing rows in one query?

Otherwise I have to run a select query to see if it's there and then
another one to update/insert.

What I'm trying to do is create a counter for each key, insert a value
of 1 or increment the value by 1 and then set another specific row
(where key = $key) to always increment by 1.

And the more I type, the more this sounds like the answer is going to be
part function, part trigger....  Maybe I should post to 'novice' for a
while!  ;)


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

Предыдущее
От: Richard Huxton
Дата:
Сообщение: Re: About table schema
Следующее
От: Paul Thomas
Дата:
Сообщение: Re: insert/update