From: | "amy cheng" <amycq(at)hotmail(dot)com> |
---|---|
To: | ctassell(at)isn(dot)net, amycq(at)hotmail(dot)com, pgsql-general(at)hub(dot)org |
Subject: | Re: [GENERAL] two serial fields within one table? |
Date: | 1999-10-12 14:51:40 |
Message-ID: | 19991012215140.22548.qmail@hotmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
different frequency: eventid is much less frequent having
null (i.e., eventid often has values), while schedid usually
always null. A thorough normalized design is make a event table,
then, eventid in table tmpschedule will be, as you suggested, int.
However, eventaddtime is seldom updated. So, I prefer the denormalized
design. Hence 2 serial type fields.
Thanks for your reply. Now I know at least it is not my fault ;-)
I'll try to manually create the missing sequence. Or, just use
sequence directly.
>From: Charles Tassell <ctassell(at)isn(dot)net>
>To: "amy cheng" <amycq(at)hotmail(dot)com>, pgsql-general(at)hub(dot)org
>Subject: Re: [GENERAL] two serial fields within one table?
>Date: Tue, 12 Oct 1999 17:52:28 -0300
>
>I tried it here and it doesn't work for me either, but I was wondering why
>you would want to do this anyway? All you are doing is creating two fields
>(schedid and eventid) that are going to contain the same value when a new
>record is inserted. If you are just using them to link to other tables
>that have a serial type, use an int (which I believe is the actual type for
>the sequence macro.) If you are going to link to this table from two other
>tables, why not just combine the two keys and link both of the other tables
>to schedid?
>
>At 04:31 PM 10/12/99, amy cheng wrote:
> >hi, there,
> >
> >I use two serial type fields within one table, seems psql does not
> >like it: it override the first one with the second one! Why? (seems to me
> >quite often if I do not want to normize it too much) or
> >something else?
> >
> >here is the table:
> >
> >create table tmpschedule
> >(
> > schedid serial,
> > addtime datetime,
> > eventid serial,
> > eventaddtime datetime,
> > poll int
> >);
> >
> >
> >thanks in advance!!!
> >
> >
> >
> >______________________________________________________
> >Get Your Private, Free Email at http://www.hotmail.com
> >
> >************
> >
>
>
>************
>
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com
From | Date | Subject | |
---|---|---|---|
Next Message | amy cheng | 1999-10-12 15:12:14 | Re: [GENERAL] stored procedure revisited |
Previous Message | greg | 1999-10-12 13:06:57 | Unrecognized variable client_encoding... |