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 1ojDkP-0001CN-Pm for pgsql-sql@arkaria.postgresql.org; Fri, 14 Oct 2022 06:00:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ojDkO-0008PH-4Y for pgsql-sql@arkaria.postgresql.org; Fri, 14 Oct 2022 06:00:40 +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 1ojDkN-0008Kv-QC for pgsql-sql@lists.postgresql.org; Fri, 14 Oct 2022 06:00:39 +0000 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ojDkL-0005Tk-JI for pgsql-sql@lists.postgresql.org; Fri, 14 Oct 2022 06:00:38 +0000 Received: by mail-ej1-x62d.google.com with SMTP id r17so8269462eja.7 for ; Thu, 13 Oct 2022 23:00:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=1qK7KGoG5ZtnArWo8T5KMk0Yb0yMgj3GZouhlBPRAaU=; b=neaAbHpcg755CwDgtUk7T4KmTFrfaBLtE9NDUn0CQEGe/7XwKpm6Dg7tb52h+5cGVo 9pNh22MGiAv8iWs5SvzY0z3WBZ3fGNc0eFuSrXmrZ9R6Lms1ow65v6ECFdmWCdNyu7iG wB6LKsYp2TIwH8SqOdk+6rSiF2wuB84pQTXrgTxkjdVPvmdsbeFLGHUti3HHdqGYNRqc V9xkXP22lwBoVX7PwGkjVO5a9OjZ7pFM0aId25rNacUB6ZC5Ib/0MI+U0tMMJoKTeaaL bniOc01ND+hF/FHq4/UGMR8cwTUUhyEl7yJNcfe4z46PciusiSK7jxkfBuKXNyMQm0ON HA1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=1qK7KGoG5ZtnArWo8T5KMk0Yb0yMgj3GZouhlBPRAaU=; b=pwF9Mjeph6YJPESEW7Ue4T+fHIgUFzTilVbSHHs08GCc9cc6KC7V+vu0jix3Za8s0O vPaRSCa6pe+zEYNX2ofDBU0H1zQRWm9EDQnC7cfFG3JSq21x2H1FAoEj6Uap2kUeXRFx sKsEboTDGfYvvtRViVZG5bAEfxAk7p9iC1SuZDNgB3QCRY04WRa8V7lmS3r8jQR6Aqs6 R/P9X+NfqETJtiFHcFRpxgcBvKzQxNZA2ev7TQlannw8cAKMkgISDuz20EkQM1an8kEE CkldyDMtXcp+kjqRwVHtAv9GmotwuVTmfpwvP2tQkHPqSzsQyPPCSIwKOJhy6u+eyImU Wm5g== X-Gm-Message-State: ACrzQf1ov+Ejh1tAB5eWs/SGvEgOJZh+MxuONvpZkd6ANrGzfqbeWkJa K1sZWWKhfpUxevt1O/sD0DfdJ2/K5NJckBel8jkqFPPT X-Google-Smtp-Source: AMsMyM6lxXyULFSAVXznudhm6idA/DoxDhmLxDSiBXQStyEz7+VouNYTwcs2bY3qRZWE7JstVO6JoFmmbnHTjZAGO5Q= X-Received: by 2002:a17:907:2e19:b0:78e:11cc:3bc5 with SMTP id ig25-20020a1709072e1900b0078e11cc3bc5mr2345439ejc.543.1665727236071; Thu, 13 Oct 2022 23:00:36 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Shaozhong SHI Date: Fri, 14 Oct 2022 07:00:24 +0100 Message-ID: Subject: Append a list of tables to an empty table to form a whole table To: pgsql-sql Content-Type: multipart/alternative; boundary="00000000000032e4c405eaf85802" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000032e4c405eaf85802 Content-Type: text/plain; charset="UTF-8" How best to append a list of tables to an empty table to form a whole table? Pseudo codes show the desirable logic. There are a list of tables with exactly same colums table_a table_b table_c Create an empty table emp_table Foreach a_name in ARRAY ARRAY['table_a', 'table_b', 'table_c'] loop insert into em_table as select * from table a_name end loop; Can something like that be done is PostGIS? Regards, David --00000000000032e4c405eaf85802 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


How best to append a list of tables to an empty= table to form a whole table?

Pseudo codes show the desi= rable logic.



Th= ere are a list of tables with exactly same colums
table_a
table_b
table_c

Create an empty table= =C2=A0 emp_table

Foreach a_name in ARRAY ARRAY[= 9;table_a', 'table_b', 'table_c'] loop
=C2=A0= =C2=A0insert into em_table as select * from table a_name

end loop;

Can something like that be= done is PostGIS?

Regards,

David
--00000000000032e4c405eaf85802--