pg.ddx.io pgsql-general@postgresql.org mailing list archivehelp / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Bryn Llewellyn <bryn@yugabyte.com>
Cc: pgsql-general list <pgsql-general@lists.postgresql.org>
Subject: Re: select (17, 42)::s.t2 into... fails with "invalid input syntax"
Date: Wed, 08 Mar 2023 21:26:40 -0500
Message-ID: <281321.1678328800@sss.pgh.pa.us> (raw)
In-Reply-To: <C68A39DC-A728-41A2-ADD7-A004DB4156FD@yugabyte.com>
References: <C68A39DC-A728-41A2-ADD7-A004DB4156FD@yugabyte.com>
Bryn Llewellyn <bryn@yugabyte.com> 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
view thread (9+ messages) latest in thread
Message-ID: <281321.1678328800@sss.pgh.pa.us> Permalink: ../281321.1678328800@sss.pgh.pa.us/ Also on: postgresql.org/message-id/281321.1678328800@sss.pgh.pa.us ·
reply
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Reply to all the recipients from your mail client; the link fills in the headers below: reply via email Some clients, webmail especially, drop In-Reply-To and References from a link, and the reply then starts a new thread: use the mbox below. To: pgsql-general@postgresql.org Cc: tgl@sss.pgh.pa.us, bryn@yugabyte.com Subject: Re: select (17, 42)::s.t2 into... fails with "invalid input syntax" In-Reply-To: <281321.1678328800@sss.pgh.pa.us> References: <C68A39DC-A728-41A2-ADD7-A004DB4156FD@yugabyte.com> <281321.1678328800@sss.pgh.pa.us> * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox