Re: how do i avoid multiple sessions from inserting the - Mailing list pgsql-general

From Dennis Gearon
Subject Re: how do i avoid multiple sessions from inserting the
Date
Msg-id FAVR2ZF0JFFC3Y934YIRPVQBAOMQKPL.3e5a6975@cal-lab
Whole thread Raw
In response to Re: how do i avoid multiple sessions from inserting the  (Kolus Maximiliano <Kolus.maximiliano@bcr.com.ar>)
List pgsql-general
You might have duplicate john doeos with diffent ID's

2/24/2003 9:51:40 AM, Kolus Maximiliano <Kolus.maximiliano@bcr.com.ar> wrote:

>
>
>  From:   Kolus Maximiliano <Kolus.maximiliano@bcr.com.ar>
>
>  To:     patrick.fiche@aqsacom.com, pgsql-general@postgresql.org
>  Subject:Re: [GENERAL] how do i avoid multiple sessions from inserting the
>  Date:   Mon, 24 Feb 2003 14:51:40 -0300
>
>
>
>
>  > Why not something like that ?
>
>  [...]
>  > 2) IF NULL -> INSERT INTO users values (....'blah' )  WHERE NOT EXISTS
>  ....
>  >                -> SELECT id FROM users WHERE email = 'blah'
>
>
>  I tried, but it's giving me an error, as if INSERT wouldn't like the WHERE:
>
>
>  INSERT INTO users (email) VALUES ('john@doe.com')
>          WHERE NOT EXISTS
>                  (SELECT id FROM users WHERE email='john@doe.com');
>
>
>  ERROR:  parser: parse error at or near "WHERE"
>
>
>  (Btw, i didnt know that INSERT would accept a WHERE clause)
>




pgsql-general by date:

Previous
From: Larry Rosenman
Date:
Subject: Re: A few questions to real pgsql gurus
Next
From: Dennis Gearon
Date:
Subject: Re: 7.4?