Re: [GENERAL] two serial fields within one table? - Mailing list pgsql-general

From Charles Tassell
Subject Re: [GENERAL] two serial fields within one table?
Date
Msg-id 4.1.19991012174655.00980380@mailer.isn.net
Whole thread Raw
In response to two serial fields within one table?  ("amy cheng" <amycq@hotmail.com>)
List 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
>
>************
>


pgsql-general by date:

Previous
From: Yin-So Chen
Date:
Subject: Re: [GENERAL] stored procedure revisited
Next
From: "Tim Joyce"
Date:
Subject: trouble updating