Re: foreign key

From: Eric McKeeth <eldin00(at)gmail(dot)com>
To: Haris <fbogdanovic(at)xnet(dot)hr>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: foreign key
Date: 2011-03-18 05:23:55
Message-ID: AANLkTikcUMBjNFWPF9hgwqB5F+2U158kZQKXkbNYxao8@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

2011/3/16 Haris <fbogdanovic(at)xnet(dot)hr>

> How to make a foreign key in pgAdmin ?
> I want to make a foreign key that references
> a primary key.
> A primary key is of type "serial",
> does that mean that foreign key should be "integer" or
> some other type ?
>

Yes, your foreign key should be of type integer. Serial is just a shortcut
for creating an integer with an associated sequence and default setting.

-Eric

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Andrew Hoyt 2011-03-18 11:51:54 Postgresql iPhone
Previous Message aaronenabs 2011-03-17 22:17:04 Re: Accessing dead rows within postgresql