... - Mailing list pgsql-general

From Mikail Majorov
Subject ...
Date
Msg-id 20020118162743.1c478689.mik@ttn.ru
Whole thread Raw
List pgsql-general
Hi!

Very simple database: 3 tables - "PAYS", "SERVICES", "CONTRACTS".

Table "PAYS" (One of coloms is customers pays - "pays.sum")
Table "SERVICES" (One of coloms is customers service - "services.sum")
TABLE "CONTRACT" (One of coloms is customere account - "contract.sum")

contract.sum = pays.sum - services.sum

I want design privilages concept on native postgress database users and permissions.
I don't want grant permissions DELETE, UPDATE on table "CONTRACT" to anybody.
I grant full permissions on PAYS & SERVICE and write triger named "change account".
When somebody change "pays.sum" or "services.sum" my triger "change account" execute and
change "contract.sum". I think this behaivour give me consistent database!
How can I realize than scheme ?! I was try but triger don't update "CONTRACT" :(

Mik.

pgsql-general by date:

Previous
From: Vince Vielhaber
Date:
Subject: Re: Books on PostgreSQL
Next
From: "Johnson, Shaunn"
Date:
Subject: Re: Books on PostgreSQL