Re: Create Table with Foreign Key Error

Поиск
Список
Период
Сортировка
От Gaetano Mendola
Тема Re: Create Table with Foreign Key Error
Дата
Msg-id 411951EC.70606@bigfoot.com
обсуждение исходный текст
Список 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 по дате отправления:

Предыдущее
От: Robert Fitzpatrick
Дата:
Сообщение: Sorting varchar w/single digits
Следующее
От: Sven Willenberger
Дата:
Сообщение: Re: pg_restore with Fc fails with [archiver] out of memory