From: zoulx1982@163.com
To: pgsql-bugs@postgresql.org
Subject: BUG #14330: can not select into `composite data types` in plpgsql
Date: Wed, 21 Sep 2016 03:51:14 +0000
Message-ID: <20160921035114.1348.3689@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
The following bug has been logged on the website:
Bug reference: 14330
Logged by: lx zou
Email address: zoulx1982@163.com
PostgreSQL version: 9.5.1
Operating system: win7 6.1.7601
Description:
Hi,
when i use composite type in plpgsql, i found it does't work when i
select a composite type column into a composite type variable.
But it can work well when i use another style like this:
select (y).a,(y).b into tmp from t....
following is a full example. Thanks.
create type mytype(a int, b text);
create table mytab(x int, y mytype);
insert into mytab values(1, (1, 'abcd'));
do $$
declare
tmp mytype;
begin
--ERROR: invalid input syntax for integer: "(1,asddd)"
--CONTEXT: PL/pgSQL function inline_code_block line 6 at SQL statement
select y into strict tmp from mytab;
raise notice '%,%', (tmp).a, (tmp).b;
end;
$$;
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
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-bugs@postgresql.org
Cc: zoulx1982@163.com
Subject: Re: BUG #14330: can not select into `composite data types` in plpgsql
In-Reply-To: <20160921035114.1348.3689@wrigleys.postgresql.org>
References: <20160921035114.1348.3689@wrigleys.postgresql.org>
* 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