Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 97F18B5DC33 for ; Mon, 5 Sep 2011 06:48:55 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 61179-04 for ; Mon, 5 Sep 2011 09:48:49 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail1.hosting.digiweb.ie (mail1.hosting.digiweb.ie [89.234.64.49]) by mail.postgresql.org (Postfix) with SMTP id 9678DB5DC21 for ; Mon, 5 Sep 2011 06:48:48 -0300 (ADT) Received: (qmail 32290 invoked by uid 399); 5 Sep 2011 09:48:46 -0000 Received: from unknown (HELO ?127.0.0.1?) (ray@teladesign.ie@86.43.79.16) by mail1.hosting.digiweb.ie with SMTP; 5 Sep 2011 09:48:46 -0000 X-Originating-IP: 86.43.79.16 Message-ID: <4E649AFC.2060909@iol.ie> Date: Mon, 05 Sep 2011 10:48:44 +0100 From: Raymond O'Donnell Reply-To: rod@iol.ie User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:6.0.1) Gecko/20110830 Thunderbird/6.0.1 MIME-Version: 1.0 To: =?ISO-8859-1?Q?Pau_Marc_Mu=F1oz_Torres?= CC: pgsql general Subject: Re: conditional insert References: In-Reply-To: X-Enigmail-Version: 1.3.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Antivirus: avast! (VPS 110904-1, 04/09/2011), Outbound message X-Antivirus-Status: Clean X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201109/98 X-Sequence-Number: 179456 On 05/09/2011 10:38, Pau Marc Muņoz Torres wrote: > Hi follk > > i trying to performe a conditional insert into a table, indeed, what > i'm trying to do is not insert a record into the table if that record exist > > googleling i found something like > > insert into XX values (1,2,3) where not exist (select ....); > > but i'm having and error near where... > Shouldn't it be EXISTS, not EXIST? Anyway, what is the error you're getting? Ray. -- Raymond O'Donnell :: Galway :: Ireland rod@iol.ie