Re: How to union all tables in a schema into one whole table?

From: Frank Gard <frank(dot)von(dot)postgresql(dot)org(at)familie-gard(dot)de>
To: pgsql-sql(at)lists(dot)postgresql(dot)org
Subject: Re: How to union all tables in a schema into one whole table?
Date: 2022-10-13 17:17:00
Message-ID: 06e0486c-341c-a6b8-e076-5e704179714d@familie-gard.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi,

I don't know much about your tables, but maybe (i.e. when they comply with the requirements) you could use table partitioning. Create a partitioned table and use "ALTER TABLE … ATTACH PARTITION …" to bring them all together.

See https://www.postgresql.org/docs/current/ddl-partitioning.html#DDL-PARTITIONING-DECLARATIVE and the ALTER TABLE statement for details.

Cheers,
Frank.

Am 13.10.22 um 19:02 schrieb Shaozhong SHI:
> A series of table like tttt.table1, ttt.table2 has been generated in the schema ttt.
>
> How best to union all these tables into a whole one?
>
> They have the exact same columns.
>
> Regards,
>
> David

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Shaozhong SHI 2022-10-14 06:00:24 Append a list of tables to an empty table to form a whole table
Previous Message Karsten Hilbert 2022-10-13 17:06:07 Aw: How to union all tables in a schema into one whole table?