From: | zoulx1982(at)163(dot)com |
---|---|
To: | pgsql-bugs(at)postgresql(dot)org |
Subject: | BUG #14330: can not select into `composite data types` in plpgsql |
Date: | 2016-09-21 03:51:14 |
Message-ID: | 20160921035114.1348.3689@wrigleys.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
The following bug has been logged on the website:
Bug reference: 14330
Logged by: lx zou
Email address: zoulx1982(at)163(dot)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;
$$;
From | Date | Subject | |
---|---|---|---|
Next Message | Michael Paquier | 2016-09-21 04:17:04 | Re: BUG #14243: pg_basebackup failes by a STATUS_DELETE_PENDING file |
Previous Message | John R Pierce | 2016-09-20 23:10:05 | Re: Segmentation fault with pg_restore |