Insert Or update - Mailing list pgsql-general

From Anton Nikiforov
Subject Insert Or update
Date
Msg-id 40891EA5.9090504@nikiforov.ru
Whole thread Raw
Responses Re: Insert Or update
List 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

Attachment

pgsql-general by date:

Previous
From: Bruno Wolff III
Date:
Subject: Re: Question about inserts
Next
From: "Stijn Vanroye"
Date:
Subject: Re: Question about inserts