• Some users have recently had their accounts hijacked. It seems that the now defunct EVGA forums might have compromised your password there and seems many are using the same PW here. We would suggest you UPDATE YOUR PASSWORD and TURN ON 2FA for your account here to further secure it. None of the compromised accounts had 2FA turned on.
    Once you have enabled 2FA, your account will be updated soon to show a badge, letting other members know that you use 2FA to protect your account. This should be beneficial for everyone that uses FSFT.

SQL Create Tables Help

azuro

n00b
Joined
Dec 14, 2002
Messages
62
I have the following tables in my database:

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.
 
Back
Top