Re: type bug?

From: Ron <ronljohnsonjr(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: type bug?
Date: 2021-10-06 05:21:07
Message-ID: 5ab20c6a-f8d0-43e8-09c3-ef670c350739@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


What version of Postgresql do you think has the bug?
Where did you get the Postgresql binaries from?
What platform?

On 10/5/21 10:50 PM, ml(at)ft-c(dot)de wrote:
> Hello,
>
> there is a bug with types in functions. Here is an example:
>
> --drop type  xyz;
> create type xyz as ( x numeric,  y numeric,  z numeric );
>
> --drop table  test_xyz ;
> create table test_xyz (  a int,  b xyz, c xyz );
> insert into  test_xyz values
> ( 1,(11.1, 12.3, 14.5 ), (22.2, 22.3, 24.5 ) ) ;
>
> --drop  function test_xyz() ;
> create function test_xyz() returns table ( a xyz, b xyz)  as
> $$
>  select b, c from test_xyz ;
> $$ language sql ;
>
> --drop   function test_xyz2() ;
> create function test_xyz2() returns table ( b xyz)  as
> $$
>  select  b from test_xyz  ;
> $$ language sql ;
>
> --drop   function test_xyz3() ;
> create function test_xyz3() returns table ( b xyz)  as
> $$
> declare
>   bb xyz;
>   cc xyz;
> begin
>   select b, c into bb, cc from test_xyz ;
>   return bb ;
> end;
> $$ language plpgsql ;
> -- ------
> select * from test_xyz() ;
> select * from test_xyz2() ; -- 3 columns, but 1 should be correct?
> select b from test_xyz2() ; -- error
> select x from test_xyz2() ; -- never declared column
> select * from test_xyz3() ; -- compiling error
> -- ------
>
> (I am not a member of the pg-developer mailinglist. )
>
> Franz
>
>
>

--
Angular momentum makes the world go 'round.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Lewis 2021-10-06 05:23:52 Re: Query time related to limit clause
Previous Message ml 2021-10-06 03:50:25 type bug?