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 1pa5zW-00024Z-E4 for pgsql-general@arkaria.postgresql.org; Thu, 09 Mar 2023 02:26:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pa5zU-0002qy-T1 for pgsql-general@arkaria.postgresql.org; Thu, 09 Mar 2023 02:26:48 +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 1pa5zU-0002mh-HC for pgsql-general@lists.postgresql.org; Thu, 09 Mar 2023 02:26:48 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pa5zN-0008E8-OB for pgsql-general@lists.postgresql.org; Thu, 09 Mar 2023 02:26:47 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 3292Qe0i281322; Wed, 8 Mar 2023 21:26:40 -0500 From: Tom Lane To: Bryn Llewellyn cc: pgsql-general list Subject: Re: select (17, 42)::s.t2 into... fails with "invalid input syntax" In-reply-to: References: Comments: In-reply-to Bryn Llewellyn message dated "Wed, 08 Mar 2023 16:41:39 -0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <281320.1678328800.1@sss.pgh.pa.us> Date: Wed, 08 Mar 2023 21:26:40 -0500 Message-ID: <281321.1678328800@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Bryn Llewellyn writes: > select (17, 42)::s.t2 into r2; > [ doesn't work ] This would work as select 17, 42 into r2; In general, SELECT INTO with a composite target expects to see a source column per target field. If you want to assign a composite value to the whole target, don't use SELECT INTO; use an assignment statement. regards, tom lane