Conditions in PostGres SQL

From: Stephan Richter <srichter(at)cbu(dot)edu>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Conditions in PostGres SQL
Date: 2000-06-23 00:03:11
Message-ID: 4.3.1.0.20000622165052.00aa0200@198.78.130.6
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello everyone,

I want to do the following SQL statement:

I want to check whether an entry exists. If it does not exist, add an entry
to the table, otherwise update the existing one:

Pseudo code:

IF entry IN table
UPDATE entry
ELSE
ADD entry
FI

Does anyone know how to do that?

Regards,
Stephan
--
Stephan Richter
CBU - Physics and Chemistry
Web2k - Web Design/Development & Technical Project Management

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ryan Kirkpatrick 2000-06-23 00:36:34 Re: Sequences do not obey transactions...
Previous Message Tom Lane 2000-06-22 22:34:27 Re: Re: [GENERAL] libpq error codes