Re: Table Relationships - Mailing list pgsql-sql

From A. Kretschmer
Subject Re: Table Relationships
Date
Msg-id 20061031184843.GA12767@a-kretschmer.de
Whole thread Raw
In response to Table Relationships  (Curtis Scheer <Curtis@DAYCOS.com>)
Responses Re: Table Relationships
List pgsql-sql
am  Tue, dem 31.10.2006, um 11:15:26 -0600 mailte Curtis Scheer folgendes:
> Given the following two tables:
> 
> CREATE TABLE public.task
> (
>   taskid int4 NOT NULL DEFAULT nextval('task_taskid_seq'::regclass),
>   description varchar,
>   CONSTRAINT pk_taskid PRIMARY KEY (taskid)
> )
> 
> public.users
> (
>   userid int4 NOT NULL,
>   username varchar,
>   CONSTRAINT pk_userid PRIMARY KEY (userid)
> )
> 
> I want to record which user ?performed the task? and which user ?checked the
> task?, I?ve come up with a few ideas on this but I would like to know what the
> correct way would be to implement this into my table design.

Perhaps a table like this:


(   user int references public.users,   task int references public.task,   ts timestamptz default now(),   action
char(1)check (action in ('p','c'))
 
)


-- with p(perform), c(cheked)



HTH, Andreas
-- 
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47215,   D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID:   0x3FFF606C, privat 0x7F4584DA   http://wwwkeys.de.pgp.net


pgsql-sql by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: [HACKERS] Case Preservation disregarding case
Next
From: "Aaron Bono"
Date:
Subject: Re: Table Relationships