Re: Database with "override" tables - Mailing list pgsql-sql

From Michael Burke
Subject Re: Database with "override" tables
Date
Msg-id 4396ED77.5000608@engtech.ca
Whole thread Raw
In response to Re: Database with "override" tables  ("Lane Van Ingen" <lvaningen@esncc.com>)
List pgsql-sql
Lane Van Ingen wrote:

>Not quite sure how to answer this, but one thought does occur to me: I was
>perhaps assuming that an override table would override an entire record in
>the 'original' table(that is what we are doing), and we require that
>critical fields in the override field be NOT NULL (and in some cases,
>provide DEFAULT values). Will that help?
>  
>
I fought with the UNION method for a while before backing off to my 
extremely-long-query system with a FULL JOIN:


SELECT COALESCE(ot.desc, it.desc) FROM initial_table it FULL JOIN 
override_table ot ON it.initial_id = ot.initial_id;


It's not so bad until you get to cross-reference other tables that have 
override tables, but then it just becomes pretty ugly.  So I'll stick 
with that for now.

If the override table did indeed override entire records in the original 
table, the UNION would have worked beautifully and probably made things 
cleaner.  Thanks for the advice.

Mike.


pgsql-sql by date:

Previous
From: Jure Kodzoman
Date:
Subject: constrains problem...
Next
From: Alexander Stanier
Date:
Subject: How to increase row deletion efficiency?