Re: making a rule and know when it is violated

From: "Nico" <nicohmail-postgresql(at)yahoo(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: making a rule and know when it is violated
Date: 2005-02-21 18:45:49
Message-ID: cvdach$2hd4$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

I don't know how to write it in postgresql.
"Guillaume Cottenceau" <gc(at)mnc(dot)ch> schreef in bericht
news:87acpxlwkx(dot)fsf(at)meuh(dot)mnc(dot)ch(dot)(dot)(dot)
> "Nico" <nicohmail-postgresql 'at' yahoo.com> 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
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly
>

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Valentin Rodionov 2005-02-21 22:56:38 setObject(i,null) and general "setNull" problems
Previous Message Guillaume Cottenceau 2005-02-21 16:14:06 Re: making a rule and know when it is violated