Re: Insert Or update - Mailing list pgsql-general

From Bas Scheffers
Subject Re: Insert Or update
Date
Msg-id 4148.212.124.229.1.1082731983.squirrel@io.scheffers.net
Whole thread Raw
In response to Insert Or update  (Anton Nikiforov <anton@nikiforov.ru>)
Responses Re: Insert Or update
List pgsql-general
What do you need to do more of, inserts or updates? If the answer is
updates, just do an update and then check for the number of rows affected.
If it is 0, follow it with an insert, if not, you are done.

You could do this in a stored procedure to save you the round trip of data
between the DB and your application and will be faster.

Cheers,
Bas.

pgsql-general by date:

Previous
From: Bruno Wolff III
Date:
Subject: Re: Question about inserts
Next
From: Bruno Wolff III
Date:
Subject: Re: Insert Or update