Re: [GENERAL] two serial fields within one table?

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: 1999-10-12 20:52:28
Message-ID: 4.1.19991012174655.00980380@mailer.isn.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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
>
>************
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tim Joyce 1999-10-12 21:59:03 trouble updating
Previous Message Yin-So Chen 1999-10-12 20:34:54 Re: [GENERAL] stored procedure revisited