Re: Primary & Foreign Keys in pgAdmin

From: Raymond O'Donnell <rod(at)iol(dot)ie>
To: MrTeeth <lateefnation(at)gmail(dot)com>
Cc: pgadmin-support(at)postgresql(dot)org
Subject: Re: Primary & Foreign Keys in pgAdmin
Date: 2012-03-15 23:08:44
Message-ID: 4F62767C.6000408@iol.ie
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support

On 15/03/2012 21:50, MrTeeth wrote:
> I was wondering can some give me an explanation on how to assign primary and
> foreign keys in pgAdmin?
>
> I can't find any information online.
>
> For example...I've got a Student table with all their details (address,
> d.o.b. and etc.). I'm going to add a student_number to the table and make it
> a primary key.

In the tree view on the left, right-click on the table and select "New
object", then "New primary key".

If the table already has a primary key, you can drop it and make your
new student number the PK instead. Click the "+" to see the table
attributes; under "constraints", select the PK, right-click and select
"Delete/drop". Add the new PK as above.

>
> I just want to know how do I do that using pgAdmin? And if you may be kind
> to explain give me further information on using Primary Keys in postgreSQL
> (and pgAdmin). The same case with the foreign keys.

Any tutorial on databases will explain PKs and FKs much better than I
can; they're not specific to Postgres.

HTH,

Ray.

--
Raymond O'Donnell :: Galway :: Ireland
rod(at)iol(dot)ie

In response to

Responses

Browse pgadmin-support by date

  From Date Subject
Next Message MrTeeth 2012-03-15 23:19:58 Re: Primary & Foreign Keys in pgAdmin
Previous Message MrTeeth 2012-03-15 21:50:33 Primary & Foreign Keys in pgAdmin