I have the following tables in my database:
And I'm trying to create the following table:
and receive the following error from postgresql:
ERROR: CREATE TABLE: number of referencing and referenced attributes for foreign key disagree
Can someone tell me what's the problem is? Thanks.
Code:
CREATE TABLE File (
PathName char(256),
FileName char(25),
Extension char(10),
PRIMARY KEY (PathName)
);
CREATE TABLE Records (
PathName char(256),
TimeStamp char(50),
PRIMARY KEY (PathName, TimeStamp)
);
And I'm trying to create the following table:
Code:
CREATE TABLE File_Records (
PathName char(256),
TimeStamp char(50),
Status char(20),
PRIMARY KEY (PathName, TimeStamp),
FOREIGN KEY (PathName) REFERENCES File,
FOREIGN KEY (TimeStamp) REFERENCES Records
);
and receive the following error from postgresql:
ERROR: CREATE TABLE: number of referencing and referenced attributes for foreign key disagree
Can someone tell me what's the problem is? Thanks.