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

Поиск
Список
Период
Сортировка
От Pierre-Frédéric Caillaud
Тема Re: most idiomatic way to "update or insert"?
Дата
Msg-id opsb8ykvcgcq72hf@musicbox
обсуждение исходный текст
Ответ на Re: most idiomatic way to "update or insert"?  (Lincoln Yeoh <lyeoh@pop.jaring.my>)
Список pgsql-general
I use stored procedures :

create function insertorupdate(....)
    UPDATE mytable WHERE ... SET ...
    IF NOT FOUND THEN
        INSERT INTO mytable ...
    END IF;


    You lose flecibility in your request though.

    I wish Postgresql had an INSERT OR UPDATE like MySQL does. So far it's
the only thing that I regret from MySQL.

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

Предыдущее
От: "Scott Marlowe"
Дата:
Сообщение: Re: Test case for bug fix in 7.4.3
Следующее
От: Prabu Subroto
Дата:
Сообщение: Re: Sequence Question