Re: Assignment to composite type variable fails inside function but running query separately yields correct type & value ?

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Tobias Gierke <tobias(dot)gierke(at)code-sourcery(dot)de>
Cc: PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: Assignment to composite type variable fails inside function but running query separately yields correct type & value ?
Date: 2021-01-26 15:08:07
Message-ID: CAKFQuwapumtrdWSWZXNGoLxqC8eeseeZx1H-EgB3C3Qor+y_-g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Tue, Jan 26, 2021 at 5:56 AM Tobias Gierke <
tobias(dot)gierke(at)code-sourcery(dot)de> wrote:

> voip$# SELECT (t1.a_major, t1.a_minor )::version_num INTO _myid
>
> Bug or feature ?
>
>
Feature. The first column of the select result gets placed into the first
field of _myid, the second column of the select result gets placed into the
second field of _myid. This is how assignment to row-typed variables (and
record-typed too) works in pl/pgsql.

David J.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tobias Gierke 2021-01-26 15:19:37 Re: Assignment to composite type variable fails inside function but running query separately yields correct type & value ?
Previous Message Tobias Gierke 2021-01-26 12:56:44 Assignment to composite type variable fails inside function but running query separately yields correct type & value ?