Re: select (17, 42)::s.t2 into... fails with "invalid input syntax" - Mailing list pgsql-general

From Tom Lane
Subject Re: select (17, 42)::s.t2 into... fails with "invalid input syntax"
Date
Msg-id 281321.1678328800@sss.pgh.pa.us
Whole thread Raw
In response to select (17, 42)::s.t2 into... fails with "invalid input syntax"  (Bryn Llewellyn <bryn@yugabyte.com>)
Responses Re: select (17, 42)::s.t2 into... fails with "invalid input syntax"
List pgsql-general
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



pgsql-general by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: select (17, 42)::s.t2 into... fails with "invalid input syntax"
Next
From: Bryn Llewellyn
Date:
Subject: Re: select (17, 42)::s.t2 into... fails with "invalid input syntax"