public inbox for [email protected]  
help / color / mirror / Atom feed
From: Frank Gard <[email protected]>
To: [email protected]
Subject: Re: How to union all tables in a schema into one whole table?
Date: Thu, 13 Oct 2022 19:17:00 +0200
Message-ID: <[email protected]> (raw)
In-Reply-To: <CA+i5JwaHBw59OWB-c6gbu==9kOGeGxDN=eZ5QN40=RxeXR1Vjg@mail.gmail.com>
References: <CA+i5JwaHBw59OWB-c6gbu==9kOGeGxDN=eZ5QN40=RxeXR1Vjg@mail.gmail.com>

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

view thread (3+ messages)

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: How to union all tables in a schema into one whole table?
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox