Re: [GENERAL] two serial fields within one table?
От | amy cheng |
---|---|
Тема | Re: [GENERAL] two serial fields within one table? |
Дата | |
Msg-id | 19991012215140.22548.qmail@hotmail.com обсуждение исходный текст |
Список | 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@isn.net> >To: "amy cheng" <amycq@hotmail.com>, pgsql-general@hub.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
В списке pgsql-general по дате отправления: