Re: Insert Or update

From: "Bas Scheffers" <bas(at)scheffers(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Insert Or update
Date: 2004-04-23 14:53:03
Message-ID: 4148.212.124.229.1.1082731983.squirrel@io.scheffers.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruno Wolff III 2004-04-23 15:03:34 Re: Insert Or update
Previous Message Pascal Polleunus 2004-04-23 14:28:16 Synchronize unicode data using copy or pg_dump