From: | dterrors(at)hotmail(dot)com |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | Are these two creation commands functionally identical? |
Date: | 2007-08-09 20:55:06 |
Message-ID: | 1186692906.701407.154540@z24g2000prh.googlegroups.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
I want to to know if these two are functionally equivalent. Is this:
Create table "users"
(
"userid" BigSerial NOT NULL,
"name" Varchar(20),
primary key ("userid")
) Without Oids;
Create table "sales"
(
"saleid" BigSerial NOT NULL,
"userid" Bigint NOT NULL,
"parent_saleid" Bigint NOT NULL,
primary key ("saleid")
) Without Oids;
Alter table "sales" add foreign key ("userid") references
"users" ("userid") on update restrict on delete restrict;
Alter table "sales" add foreign key ("parent_saleid") references
"sales" ("saleid") on update restrict on delete restrict;
Is the above functionally identical to:
Create table "users"
(
"userid" BigSerial NOT NULL,
"name" Varchar(20),
primary key ("userid")
) Without Oids;
Create table "sales"
(
"saleid" BigSerial NOT NULL,
"userid" bigint references users(userid),
"parent_saleid" bigint references sales(saleid),
primary key ("saleid")
) Without Oids;
Using postgreSQL 8.1 if it matters, thanks.
From | Date | Subject | |
---|---|---|---|
Next Message | Decibel! | 2007-08-09 21:15:53 | Re: Dell Hardware Recommendations |
Previous Message | Woody Woodring | 2007-08-09 20:16:15 | Re: Bytea question with \208 |