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 1mHPq0-0006Dc-3Z for pgsql-novice@arkaria.postgresql.org; Sat, 21 Aug 2021 12:11:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mHPpx-0003r5-IY for pgsql-novice@arkaria.postgresql.org; Sat, 21 Aug 2021 12:10:57 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mHOdu-0004wP-Pf for pgsql-novice@lists.postgresql.org; Sat, 21 Aug 2021 10:54:26 +0000 Received: from esa05.ucs.mun.ca ([134.153.136.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mHOds-0008LH-KR for pgsql-novice@postgresql.org; Sat, 21 Aug 2021 10:54:26 +0000 IronPort-SDR: 5EzJwZKAQq7+OB7Qa8TW4twCGzawB0/fkCGFBudu98o2MX5ItQdfBdfNFvPySwQRE2KsLaAoYj EdcLh7jm6CeuDwWXSJyj/N1S6DuiHDmYbNwk5i6U6t0XjhMkAgqRDt0wKL3IQX9xatyv9zp6FV npWRHG9lQYhJX62kPZtuaaCIwpdUeVl1uEM4naurzGNoW9i3WMvXDBZFns5sTKduLAPMkwJ6FW +lZIa3cXWMH9HZQC79yaWMmZubrwk0vOJRBrB2kVtVE2g5BFMBatMR2sObwiWWBkcKUaNt/ym7 vFk= IronPort-HdrOrdr: =?us-ascii?q?A9a23=3AHDHFb603Ce8HjrK9ZekiGAqjBLYkLtp133?= =?us-ascii?q?Aq2lEZdPU1SL37qynAppUmPHPP5Qo5eHZlgtyYPbnFXHW0z/BICOoqTNSftW?= =?us-ascii?q?vd2FdARbsKhbcKgQeKJ8SUzIFgPMlbH5RWNMf9Fhxzg8r8/WCDeeod/A=3D?= =?us-ascii?q?=3D?= X-IronPort-AV: E=Sophos;i="5.84,340,1620700200"; d="scan'208";a="58670822" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from cpe00fc8db7a323-cm00fc8db7a320.cpe.net.cable.rogers.com (HELO pyrope.local) ([174.117.202.255]) by smtp05.ucs.mun.ca with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Aug 2021 08:24:22 -0330 References: <6af818d092cf9afb1f7228bca0cbab03ae17bf4d.camel@cybertec.at> User-agent: mu4e 1.5.6; emacs 27.2 From: Roger Mason To: pgsql-novice Subject: Re: plpgsql select into In-reply-to: Date: Sat, 21 Aug 2021 08:24:21 -0230 Message-ID: MIME-Version: 1.0 Content-Type: text/plain List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk David G. Johnston writes: > I suggest you should pretend that SQL's "SELECT INTO" doesn't exist. If > you want to create a table from a result write: "CREATE TABLE AS" and then > a normal select query. In particular the entire "action" command is kept > whole instead of needing to put a bunch of column names in between the > "SELECT" and the "INTO" - and you also are less likely to confuse the > plpgsql feature of the same form. Thank you David. I will try to heed that advice. Roger