Data type for serial during constraint?

From: "Rob S(dot)" <rslifka(at)home(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Data type for serial during constraint?
Date: 2000-05-30 08:33:04
Message-ID: 000001bfca11$acaae940$39117118@cr699264-a.rct1.bc.wave.home.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hiya,

I've never sent mail to a list before, so i hope i get it right =)

Downloaded and installed Postgres today for Slackware, for the first time.
Kudos to the PG team; we still can't believe it went so well. We were up,
with JDBC access in about 20 minutes. OH, a note about that... your docs
say Class.forName("postgresql.Driver") when the package created by your
makefile is really "org.postgresql.Driver" =)

Question tho': I've specified a SERIAL primary key ("fooID") in some table
("t1"). From another table, I'd like to specify that primary key as a
foreign key. I have to include a data type, but that will create another
sequencer for that field, which I would imagine is not the way root
intended? for "t2"...

CREATE TABLE "T2" ( "t2ID" SERIAL, "fooID" ???? REFERENCES "t1" ("fooID") );

What goes where the '?' are? Thanks in advance!

- Rob S.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jan Wieck 2000-05-30 08:58:40 Re: Is PostgreSQL multi-threaded?
Previous Message carl garland 2000-05-30 08:04:57 Re: Speed of locating tables