Re: Darn pop singers! - Mailing list pgsql-novice

From Ian Pilcher
Subject Re: Darn pop singers!
Date
Msg-id 40A239DB.8030005@comcast.net
Whole thread Raw
In response to Re: Darn pop singers!  (Oliver Fromme <olli@lurza.secnetix.de>)
List pgsql-novice
Oliver Fromme wrote:
>
> Create two tables, one for the real names, and one for the
> alias names.  The real_persons table would look like this:
>
>   real_id | last_name  | first_name
>  ---------+------------+------------
>         4 | Jones      | David
>
> And the aliases table would look like this:
>
>   alias_id | real_id | last_name  | first_name
>  ----------+---------+------------+------------
>          5 |       4 | Bowie      | David
>
> Of course, aliases.real_id should be made a foreign key to
> real_persons.real_id, so you cannot enter an alias for a
> real person which doesn't exist.  Note that alias_id and
> real_id are completely separate -- if you want to make them
> disjunct (for safety, so you can't mix them up), modify the
> sequences so that one produces only odd numbers and the
> other one only even numbers.  Or make one start at 10000000
> or whatever.
>
> You can conveniently create a view in order to merge real
> persons and aliases together.
>

Thank you!  I hadn't thought of using a view, but it does seem like the
right solution here.

--
========================================================================
Ian Pilcher                                        i.pilcher@comcast.net
========================================================================


pgsql-novice by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: ORDER BY and Unicode
Next
From: "M. Bastin"
Date:
Subject: Re: ORDER BY and Unicode