Re: Question about fk and uk for Database Modeler - Mailing list pgadmin-hackers

From Guillaume Lelarge
Subject Re: Question about fk and uk for Database Modeler
Date
Msg-id 4DD8AFDA.90901@lelarge.info
Whole thread Raw
In response to Question about fk and uk for Database Modeler  (Luis Ochoa <ziul1979@gmail.com>)
Responses Re: Question about fk and uk for Database Modeler
List pgadmin-hackers
On 05/20/2011 05:26 PM, Luis Ochoa wrote:
> I'm checking right now database designer way of updating / creating foreign
> keys from pk, and as part of this work I want to add uk / fk implementation,
> but I want to check some points before, because I'm not totally sure about
> it, please I'll appreciate your help.
>
> 1.How should I add option to choose between pk and uk as source of foreign
> key ?
> my idea: right click over relationship let me choose source of fk:  uk
> (allow me to choose which uk of many) or pk
>

Fine to me.

> 2. When I create a fk some columns are added to table

Why? a user could create a FK with existing columns.

> and MATCH matchtype right
> now is only MATCH FULL but I have more options to choose like: MATCH
> PARTIAL(is still no implemented yet or docs are outdated )  MATCH
> SIMPLE, . Question here is should I let the user to choose between match
> full and simple (not partial yet)?

Right click on the relationship, and the MATCH FULL/SIMPLE choice is
available in this contextual menu.

> reference:
> http://www.network-theory.co.uk/docs/postgresql/vol1/CREATETABLE.html#SEC284
>
> 3. suppose that I created a fk from a pk if I add hierarchy all fk columns
> become fk/pk that's fine, but if I created a fk from an uk and I add
> hierarchy, what should be the normal behavior?.

I don't understand what you mean here.

> docs said: Unique constraints and primary keys are not inherited in the
> current implementation. This makes the combination of inheritance and unique
> constraints rather dysfunctional. reference:
> http://www.network-theory.co.uk/docs/postgresql/vol1/CREATETABLE.html#SEC284
>

This is in the case of inheritance, mostly when you can to add
partitions to a table.

Which TODO are you working on?


--
Guillaume
 http://www.postgresql.fr
 http://dalibo.com

pgadmin-hackers by date:

Previous
From: Guillaume Lelarge
Date:
Subject: Re: A question about database designer first deliverable
Next
From: Luis Ochoa
Date:
Subject: Re: Question about fk and uk for Database Modeler