Re: Database with "override" tables
От | Michael Burke |
---|---|
Тема | Re: Database with "override" tables |
Дата | |
Msg-id | 4396ED77.5000608@engtech.ca обсуждение исходный текст |
Ответ на | Re: Database with "override" tables ("Lane Van Ingen" <lvaningen@esncc.com>) |
Список | 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 по дате отправления: