Re: if exists...does it exists for insert statments?

From: "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com>
To: "Pau Marc Munoz Torres" <paumarc(at)gmail(dot)com>
Cc: "PgSQL General ML" <pgsql-general(at)postgresql(dot)org>
Subject: Re: if exists...does it exists for insert statments?
Date: 2007-12-11 17:02:04
Message-ID: 162867790712110902o10efbfcasd2873ef206bd477e@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello

On 11/12/2007, Pau Marc Munoz Torres <paumarc(at)gmail(dot)com> wrote:
> could i use a sentence similar to the mysql sentence
>
> insert if not exist into SP values ('cesp','sp');
>

insert into sp
select 'cesp','sp'
except
select * from SP;

Regards
Pavel Stehule

> in postgresql?
>
> pau
>
>
> --
> Pau Marc Muñoz Torres
>
> Laboratori de Biologia Computacional
> Institut de Biotecnologia i Biomedicina Vicent Villar
>
> Universitat Autonoma de Barcelona
> E-08193 Bellaterra (Barcelona)
>
> telèfon: 93 5812807
> Email : paumarc(dot)munoz(at)bioinf(dot)uab(dot)cat

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Gregory Williamson 2007-12-11 17:03:39 Re: Hijack!
Previous Message Jay 2007-12-11 17:01:49 WHERE (columnX IN (x,y,z)) ORDER BY columnY conflict