Skip site navigation (1) Skip section navigation (2)

Re: Pgadmin3 v1.14.2 foreign keys

From: "Day, David" <dday(at)redcom(dot)com>
To: "Mary F(dot) Masterson" <zen(at)email(dot)hal-pc(dot)org>, "pgsql-novice(at)postgresql(dot)org"<pgsql-novice(at)postgresql(dot)org>
Subject: Re: Pgadmin3 v1.14.2 foreign keys
Date: 2012-08-06 12:01:44
Message-ID: 401084E5E73F4241A44F3C9E6FD794289AC46078@exch-01 (view raw or flat)
Thread:
Lists: pgsql-novice
Mary,

Not sure about FK via the pgadminIII gui table/columns view tool.
If you launch a query window from pgadminIII,  you can enter a command
similar to the following and it will accomplish your goal.

ALTER TABLE <schema>.address ADD FOREIGN KEY(address) 
       REFERENCES <schema>.addresstype(addresstype_id);



Rgds


Dave

> -----Original Message-----
> From: pgsql-novice-owner(at)postgresql(dot)org [mailto:pgsql-novice-
> owner(at)postgresql(dot)org] On Behalf Of Mary F. Masterson
> Sent: Saturday, August 04, 2012 4:05 PM
> To: pgsql-novice(at)postgresql(dot)org
> Subject: [NOVICE] Pgadmin3 v1.14.2 foreign keys
> 
> 
> 
> I searched the archives and didn't find the answer as to how to add
> foreign keys to a table using pgadminIII v1.14.2.  I am very familiar
> with relational databases and foreign keys, indices, etc., but I am a
> newbie to postgresql. For instance, say I have two tables, "address"
> and "addresstype", both within the same schema.  The column named
> "type" in the "address" table is the foreign key to the "addresstype"
> table, the primary key of which is named "addresstype_id".  I created
> those columns and added the primary key constraints without any
> difficulty.  I tried adding the foreign key constraint, by right-
> clicking the "constraints"
> object for the "address" table in the object browser window and
> selecting "add foreign key".  I cannot figure out the next steps.  Any
> help, please?
>  Thank you.
> 
> --
> Sent via pgsql-novice mailing list (pgsql-novice(at)postgresql(dot)org) To
> make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-novice

In response to

pgsql-novice by date

Next:From: Kevin GrittnerDate: 2012-08-06 16:08:36
Subject: Re: To get a Table or View like a Calendar with dates
Previous:From: Csanyi PalDate: 2012-08-04 20:24:27
Subject: To get a Table or View like a Calendar with dates

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group