Re: check problem - Mailing list pgsql-novice

From Michael Fuhr
Subject Re: check problem
Date
Msg-id 20060223224523.GA54616@winnie.fuhr.org
Whole thread Raw
In response to check problem  ("Luis Silva" <lfs12@hotmail.com>)
Responses Re: check problem
List pgsql-novice
On Thu, Feb 23, 2006 at 06:54:49PM +0000, Luis Silva wrote:
> I there. I having a problem. I have a table with 3 columns, identity,
> implicit_group(int) and private. if insert, for exemple, one identity with
> an implicit_group with the value '1' and a private 'aaaa' i need to
> guaranty that i can't insert another identity with an implicity_group '1'
> and a different private. How can I do this? tks a lot.

It's not clear exactly what you want to allow and prevent.  Is it
acceptable to insert a different identity with the same implicit_group
and private as the first row?  What about another row with the same
identity as the first row but with a different implicit_group and/or
private?  It might be helpful if you could indicate whether each
of the following rows, inserted in the given order, should be
accepted or rejected and why:

1) 'ident1', 1, 'aaaa'  -- first row, assumed to be accepted
2) 'ident1', 1, 'aaaa'  -- duplicate of (1)
3) 'ident1', 1, 'bbbb'  -- same ident and group as (1) but different private
4) 'ident1', 2, 'aaaa'  -- same ident and private as (1) but different group
5) 'ident1', 2, 'bbbb'  -- same ident as (1) but different group and private
6) 'ident2', 1, 'aaaa'  -- different ident as (1) but same group and private
7) 'ident2', 1, 'bbbb'  -- different ident and private as (1) but same group
8) 'ident2', 2, 'aaaa'  -- different ident and group as (1) but same private
9) 'ident2', 2, 'bbbb'  -- different ident, group, and private from (1)

It might also be helpful if you gave an abstract explanation of the
problem you're trying to solve.  Sometimes that can suggest a schema
redesign.

--
Michael Fuhr

pgsql-novice by date:

Previous
From: "Guido Barosio"
Date:
Subject: Re: Schema Questions
Next
From: "Luis Silva"
Date:
Subject: Re: check problem