From: | Gaetano Mendola <mendola(at)bigfoot(dot)com> |
---|---|
To: | John Haney <jhaney(at)cox(dot)net>, pgsql-questions(at)postgresql(dot)org |
Subject: | Re: Create Table with Foreign Key Error |
Date: | 2004-08-10 22:53:32 |
Message-ID: | 411951EC.70606@bigfoot.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
John Haney wrote:
| Postgresql 7.4.3-1 under Cygwin.
|
| I created a table called ServerTypes:
|
| CREATE TABLE ServerTypes(
| ServerTypeID SERIAL UNIQUE NOT NULL,
| Type TEXT PRIMARY KEY);
|
| Works fine.
|
| Now, I want to create a table called servers with a Foreign Key
| referencing ServerTypes.Type:
|
| CREATE TABLE Servers(
| ServerID SERIAL UNIQUE NOT NULL,
| Type REFERENCES ServerTypes (Type),
| Server TEXT PRIMARY KEY);
You forgot to specify the data type for the field Type.
Regards
Gaetano Mendola
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFBGVHq7UpzwH2SGd4RAriNAKDRKJCpgGen8VVsxg//rmjqU+O6vgCg4u/9
9zcAUYNCfaeU2i9WVTXdh3k=
=5YeH
-----END PGP SIGNATURE-----
From | Date | Subject | |
---|---|---|---|
Next Message | Amir Zicherman | 2004-08-10 22:53:33 | Locks in functions? |
Previous Message | Liam Lesboch | 2004-08-10 22:53:20 | Re: Replication options? |