X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 78E608BA2BF for ; Mon, 21 Feb 2005 16:14:23 +0000 (GMT) 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 20776-08 for ; Mon, 21 Feb 2005 16:14:14 +0000 (GMT) Received: from mnc.ch (unknown [212.23.250.43]) by svr1.postgresql.org (Postfix) with ESMTP id 573FE8BA26C for ; Mon, 21 Feb 2005 16:14:12 +0000 (GMT) Received: (qmail 26692 invoked from network); 21 Feb 2005 17:14:10 +0100 Received: from 62-2-77-204.business.cablecom.ch (HELO meuh.mnc.ch) (62.2.77.204) by www.mnc.ch.com with SMTP; 21 Feb 2005 17:14:10 +0100 Received: by meuh.mnc.ch (Postfix, from userid 1000) id 768BB23F50C; Mon, 21 Feb 2005 17:14:06 +0100 (CET) To: "Nico" Cc: pgsql-jdbc@postgresql.org Subject: Re: making a rule and know when it is violated References: From: Guillaume Cottenceau Date: 21 Feb 2005 17:14:06 +0100 In-Reply-To: Message-ID: <87acpxlwkx.fsf@meuh.mnc.ch> Lines: 22 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.053 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200502/143 X-Sequence-Number: 12323 "Nico" writes: > Hello, > I want to make a rule in phpPgAdmin(PostgreSQL 7.3.8-RH ). > Then I want to intercept any violation on that rule in java. > Here is the table creation code: > CREATE TABLE "tblUser" ( > "UserID" serial NOT NULL, > "UserName" character varying(50) NOT NULL, > "UserPass" character varying(50) NOT NULL, > "UserRoleID" integer DEFAULT 3 NOT NULL > ); > Now it's imperative that the field UserRoleID has maximum one record that > contains the integer 1. Possible other values are 2 and 3. They are allowed > to exist in more than one record. > After that I need to know in java how to know when a violation of this rule > occurs. Why not using a trigger function in postgres? -- Guillaume Cottenceau