keeping 3 tables in sync w/ each other

Поиск
Список
Период
Сортировка
От Ow Mun Heng
Тема keeping 3 tables in sync w/ each other
Дата
Msg-id 1190097752.15849.45.camel@neuromancer.home.net
обсуждение исходный текст
Ответы Re: keeping 3 tables in sync w/ each other  ("Filip Rembiałkowski" <plk.zuber@gmail.com>)
Re: keeping 3 tables in sync w/ each other  (btober@ct.metrocast.net)
Re: keeping 3 tables in sync w/ each other  (Sascha Bohnenkamp <bohnenkamp@mevisbreastcare.de>)
Список pgsql-general
Hi,

I have 3 tables

foo
foo_loading_source1
foo_loading_source2

which is something like

create table foo (a int, b int, c int)
create table foo_loading_source1 (a int, b int, c int)
create table foo_loading_source2 (a int, b int, c int)

Is there a way which can be made easier to keep these 3 tables DDL in
sync?

the loading_sourceX tables are just a temporary-in-transit table for
data \copy'ied into the DB before being inserted into the main foo
table.

Currently, each time I add a new column to foo, I have to "remember" to
add the same to the other 2 table.

Can I use inheritance? References?

or will I have to create a procedural function such that it will add the
same ddl to all 3 tables each time a new column is defined?



В списке pgsql-general по дате отправления:

Предыдущее
От: Ow Mun Heng
Дата:
Сообщение: Re: help w/ SRF function
Следующее
От: Bill Moseley
Дата:
Сообщение: pgcrypto: is an IV needed with pgp_sym_encrypt()?