Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id C0F52B5DD93 for ; Mon, 5 Sep 2011 06:45:23 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 50063-03-2 for ; Mon, 5 Sep 2011 09:45:16 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from smadev.internal.net (host3.dynacom.ondsl.gr [62.103.35.211]) by mail.postgresql.org (Postfix) with ESMTP id A6CDBB5DDA5 for ; Mon, 5 Sep 2011 06:45:15 -0300 (ADT) Received: from smadev.internal.net (localhost.internal.net [127.0.0.1]) by smadev.internal.net (8.14.2/8.14.2) with ESMTP id p859jDPt084223 for ; Mon, 5 Sep 2011 12:45:13 +0300 (EEST) (envelope-from achill@matrix.gatewaynet.com) Received: from localhost (localhost [[UNIX: localhost]]) by smadev.internal.net (8.14.2/8.14.2/Submit) id p859jDAZ084222 for pgsql-general@postgresql.org; Mon, 5 Sep 2011 12:45:13 +0300 (EEST) (envelope-from achill@matrix.gatewaynet.com) From: Achilleas Mantzios Organization: Dynacom Tankers Mgmt To: pgsql-general@postgresql.org Subject: Re: conditional insert Date: Mon, 5 Sep 2011 12:45:13 +0300 User-Agent: KMail/1.9.7 References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <201109051245.13591.achill@matrix.gatewaynet.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.279 tagged_above=-5 required=5 tests=BAYES_00=-1.9, KHOP_DYNAMIC=0.73, RCVD_IN_BRBL_LASTEXT=1.449 X-Spam-Level: X-Archive-Number: 201109/97 X-Sequence-Number: 179455 =CE=A3=CF=84=CE=B9=CF=82 Monday 05 September 2011 12:38:34 =CE=BF/=CE=B7 Pa= u Marc Mu=C3=B1oz Torres =CE=AD=CE=B3=CF=81=CE=B1=CF=88=CE=B5: > Hi follk >=20 > 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 >=20 thats why primary/unique keys are for. isolate the columns which you consider to be a correct unique key and create a unique key on them. thereis no notion of conditional insert that i know of. > googleling i found something like >=20 > insert into XX values (1,2,3) where not exist (select ....); >=20 > but i'm having and error near where... >=20 > anyone knows how do i can perfome this insert? >=20 > thanks >=20 > p >=20 =2D-=20 Achilleas Mantzios