X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id A9AC0DBC29 for ; Sun, 20 Nov 2005 03:02:07 -0400 (AST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 78391-03 for ; Sun, 20 Nov 2005 07:02:06 +0000 (GMT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from floppy.pyrenet.fr (floppy.pyrenet.fr [194.116.145.2]) by svr1.postgresql.org (Postfix) with ESMTP id BDC05DBC5D for ; Sun, 20 Nov 2005 03:02:04 -0400 (AST) Received: by floppy.pyrenet.fr (Postfix, from userid 106) id 54B9D31059; Sun, 20 Nov 2005 08:02:05 +0100 (MET) From: "JuanCri" X-Newsgroups: pgsql.sql Subject: Re: query Date: 19 Nov 2005 23:01:57 -0800 Organization: http://groups.google.com Lines: 14 Message-ID: <1132470117.345048.64260@o13g2000cwo.googlegroups.com> References: <001301c5ec00$7b25b0f0$ec1010ac@aftabn463> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Complaints-To: groups-abuse@google.com In-Reply-To: <001301c5ec00$7b25b0f0$ec1010ac@aftabn463> User-Agent: G2/0.2 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: o13g2000cwo.googlegroups.com; posting-host=201.215.213.22; posting-account=7tws-Q0AAADpX36azeU8JBvtMMi8oYJs To: pgsql-sql@postgresql.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[none] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200511/252 X-Sequence-Number: 23503 First, INSERT statements are 1 to 1 with table rows... (unless you use a insert/select). Second, if you want to probe that.. it is better to create an UNIQUE index.. isn't it? Ok, if that's not enough for you... you can create a trigger that perform a SELECT COUNT(*) with the criteria and if it's > 0, you rise an exception (sorry, I don't have access to a databae now to check the code). Juan C. Olivares www.juancri.com