From: | Michael Burke <michael(at)engtech(dot)ca> |
---|---|
To: | Lane Van Ingen <lvaningen(at)esncc(dot)com> |
Cc: | PGSQL-SQL <pgsql-sql(at)postgresql(dot)org> |
Subject: | Re: Database with "override" tables |
Date: | 2005-12-07 14:11:03 |
Message-ID: | 4396ED77.5000608@engtech.ca |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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.
From | Date | Subject | |
---|---|---|---|
Next Message | Alexander Stanier | 2005-12-07 14:36:16 | How to increase row deletion efficiency? |
Previous Message | Jure Kodzoman | 2005-12-07 12:38:04 | constrains problem... |