Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oj0OG-0005GM-H9 for pgsql-sql@arkaria.postgresql.org; Thu, 13 Oct 2022 15:44:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oj0OF-0002LG-3f for pgsql-sql@arkaria.postgresql.org; Thu, 13 Oct 2022 15:44:55 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oj0OE-0002L6-Oe for pgsql-sql@lists.postgresql.org; Thu, 13 Oct 2022 15:44:54 +0000 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oj0OB-000778-PD for pgsql-sql@lists.postgresql.org; Thu, 13 Oct 2022 15:44:53 +0000 Received: by mail-ej1-x633.google.com with SMTP id sc25so4762567ejc.12 for ; Thu, 13 Oct 2022 08:44:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=Q2IGOF/Hl/Cs7Md8U6rMw65GxVGsRxxRBFwQrCiF6JI=; b=ehgKB/VI1JBTapu+q5gHNdEjzTt8oISS9yn+RgEcNYLvQNZU2c9AKue7fe9ONWgUTB YAlAWe86qob2TBbE8jGQ1CXdWXeF8me7xSCynNeq3mLzW5rUyyFSrirWaTYkgaZvc8U/ vcqrJb4/l4WbVl0u9ey3mEBp8BUcC6FibZDRPj7nATkvhy/bupSQe2v+v2MFE69Gz3ZD 7EjegTmMdea1AyF2O7/2CuH682O953M/bOip4abip4fZtiXjU8wXbVh5ld6q4psalleY VGnoYroVY9tIUgcXQVkL9kjPyfbZ/GScBbadAoZQc1d7xW38Ld18tB7j8ZAi6ptkVc3H xiwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=Q2IGOF/Hl/Cs7Md8U6rMw65GxVGsRxxRBFwQrCiF6JI=; b=QpuxDC36nsAj+nfcnDq9Kp4lwT5Tbjxmwf+E/p5YBCSmhXT/bTnibawFr3010kgMhJ gAZba5ggHjVuYKXd50fSousVZ4DzTN+6sCKChjChJ7NnPv3ODXE+pZ6crqOU5n3Lc9g9 sTpZKR2ZJrpsFh98SGPEkWTO/NfjgqrSyEmiPD9aLltcVBsL04wovj6EEgiAmAYLL0mY a0ul9FRetcFJRyDQdupRzV3x4XvKDChHZy/VE4lm8fhX/P3ITFIm61DF1s2RGCBxHg6Y xec7ePIh+uHpsnWFnEKGnmvFAVIQMQFDGExpDX9k0TIprU+tTnVST28Kb7gRUTKF9KWC gItg== X-Gm-Message-State: ACrzQf0llriEX2XfIwY7lIrsDJL3yGBJtUELpC/KZk7tRfOFzffLlTrF YRfokYpyT67+IM/g0utoW62hfCNrMJH9chnGmODIhECpfBc= X-Google-Smtp-Source: AMsMyM4txfbLwVYHQHTl+tzbimoJn/+2cbFLh/xIILFvs+7wP6lNy4m9qu/3ueKHnb5bePq84p/szltX1vlhcUux/64= X-Received: by 2002:a17:907:a073:b0:78d:9e06:8ba9 with SMTP id ia19-20020a170907a07300b0078d9e068ba9mr292616ejc.338.1665675890411; Thu, 13 Oct 2022 08:44:50 -0700 (PDT) MIME-Version: 1.0 From: Shaozhong SHI Date: Thu, 13 Oct 2022 16:44:39 +0100 Message-ID: Subject: Can we generate a series of tables in a loop and then use another loop to union all? To: pgsql-sql Content-Type: multipart/alternative; boundary="000000000000c24d1505eaec63ad" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000c24d1505eaec63ad Content-Type: text/plain; charset="UTF-8" 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 --000000000000c24d1505eaec63ad Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Can we do the following?

for j in 1..max loop
create table j as select .............
end loop;
<= div>
Then,=C2=A0 We do=C2=A0


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
--000000000000c24d1505eaec63ad--