Re: keeping 3 tables in sync w/ each other

Поиск
Список
Период
Сортировка
От btober@ct.metrocast.net
Тема Re: keeping 3 tables in sync w/ each other
Дата
Msg-id 46EFC675.60706@ct.metrocast.net
обсуждение исходный текст
Ответ на keeping 3 tables in sync w/ each other  (Ow Mun Heng <Ow.Mun.Heng@wdc.com>)
Ответы Re: keeping 3 tables in sync w/ each other  (Ow Mun Heng <Ow.Mun.Heng@wdc.com>)
Список pgsql-general
Ow Mun Heng wrote:
> 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.
>
>


Since these are temporary tables, why don't you just create them on the
fly as temporary tables?

CREATE TEMPORARY TABLE foo_loading_source1 (LIKE foo);

CREATE TEMPORARY TABLE foo_loading_source2 (LIKE foo);

Then do your loading process. Then you don't really have to worry about
maintaining the loading tables at all.




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

Предыдущее
От: "Phoenix Kiula"
Дата:
Сообщение: Re: For index bloat: VACUUM ANALYZE vs REINDEX/CLUSTER
Следующее
От: Devrim GÜNDÜZ
Дата:
Сообщение: New PostgreSQL RPM sets are available for Fedora / RHEL