Re: Create Table with Foreign Key Error - Mailing list pgsql-general

From Gaetano Mendola
Subject Re: Create Table with Foreign Key Error
Date
Msg-id 411951EC.70606@bigfoot.com
Whole thread Raw
List 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-----


pgsql-general by date:

Previous
From: Robert Fitzpatrick
Date:
Subject: Sorting varchar w/single digits
Next
From: Sven Willenberger
Date:
Subject: Re: pg_restore with Fc fails with [archiver] out of memory