Can we generate a series of tables in a loop and then use another loop to union all?

From: Shaozhong SHI <shishaozhong(at)gmail(dot)com>
To: pgsql-sql <pgsql-sql(at)lists(dot)postgresql(dot)org>
Subject: Can we generate a series of tables in a loop and then use another loop to union all?
Date: 2022-10-13 15:44:39
Message-ID: CA+i5JwaYSOw=aAQcNH3M22VkzKBhcf9pyG4VTKG3yCe-r41Sxg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Can we do the following?

for j in 1..max loop
create table j as select .............
end loop;

Then, We do

Alternatively, can we generate an empty table and append each newly
generated table to it so that we end up with a whole table?

Regards,

David

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Frank Gard 2022-10-13 16:50:02 Re: Can we generate a series of tables in a loop and then use another loop to union all?
Previous Message Tom Lane 2022-09-29 19:58:02 Re: [Bug][Ver 11]: Generic query plan selected is worse than custom query plan