Insert Or update

Поиск
Список
Период
Сортировка
От Anton Nikiforov
Тема Insert Or update
Дата
Msg-id 40891EA5.9090504@nikiforov.ru
обсуждение исходный текст
Ответы Re: Insert Or update  (Bruno Wolff III <bruno@wolff.to>)
Список pgsql-general
Dear All,
I have a database which stores traffic data and to update the traffic
for the particular IP i have to select this ip from the table for this
period and if it is already in the database i should run an update
statement, but if it is not presented - i should insert the data. It was
OK when i have had 2-3 millions of records, but now it is 15 millions
and i'm not complaining that it is too slow to select - no, but it takes
some time anyway.
I know that this will be helpful to write a function that will do this
for me, but it will run the same time as my insertion tool that is
written in c or even slower. So my question is: is it possible to have
"UPDATE OR INSERT" statement in the PostgreSQL like it is possible in
Oracle (as i heard but did not check it by myself yet)?

Best regards,
Anton

Вложения

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

Предыдущее
От: Bruno Wolff III
Дата:
Сообщение: Re: Question about inserts
Следующее
От: "Stijn Vanroye"
Дата:
Сообщение: Re: Question about inserts