Re: select (17, 42)::s.t2 into... fails with "invalid input syntax"
От | David G. Johnston |
---|---|
Тема | Re: select (17, 42)::s.t2 into... fails with "invalid input syntax" |
Дата | |
Msg-id | CAKFQuwZiR4paFEjiJP4py4HpHBeur=QZqi7Ys1p_XY8-WiCEYw@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: select (17, 42)::s.t2 into... fails with "invalid input syntax" (Bryn Llewellyn <bryn@yugabyte.com>) |
Ответы |
Re: select (17, 42)::s.t2 into... fails with "invalid input syntax"
|
Список | pgsql-general |
On Wed, Mar 8, 2023 at 7:58 PM Bryn Llewellyn <bryn@yugabyte.com> wrote:
r := (my_c1, my_c2)::s.t;
If you write s.x there it will also work.
Your first and third assignments are identical in syntax/nature. These are both the first examples here[1]
Yes, the behavior of INTO in the second assignment is somewhat non-intuitive; but covered here[2]. Probably it could use more examples.
The final form fits into a procedural flow better than the SQL-based one. Since plpgsql allows for procedural flow this makes sense. The composite variable reference is simply: main_type_name.field_name Hence the second example here[1]
David J.
В списке pgsql-general по дате отправления: