Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mY018-0003uS-85 for pgsql-general@arkaria.postgresql.org; Wed, 06 Oct 2021 06:03:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mY016-0006tX-W1 for pgsql-general@arkaria.postgresql.org; Wed, 06 Oct 2021 06:03:00 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mY016-0006tP-N4 for pgsql-general@lists.postgresql.org; Wed, 06 Oct 2021 06:03:00 +0000 Received: from einhorn.in-berlin.de ([192.109.42.8] helo=einhorn-mail-out.in-berlin.de) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mY011-0002A3-9R for pgsql-general@lists.postgresql.org; Wed, 06 Oct 2021 06:02:59 +0000 X-Envelope-From: ml@ft-c.de X-Envelope-To: Received: from authenticated.user (localhost [127.0.0.1]) by einhorn.in-berlin.de with ESMTPSA id 19662oqG020540 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT) for ; Wed, 6 Oct 2021 08:02:50 +0200 Message-ID: Subject: Re: type bug? From: ml@ft-c.de Reply-To: ml@ft-c.de To: pgsql-general@lists.postgresql.org Date: Wed, 06 Oct 2021 08:02:50 +0200 In-Reply-To: <5ab20c6a-f8d0-43e8-09c3-ef670c350739@gmail.com> References: <108585f3e84fc2f98e7ab7776d745ca32b7c6dc1.camel@ft-c.de> <5ab20c6a-f8d0-43e8-09c3-ef670c350739@gmail.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.40.2 FreeBSD GNOME Team MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, 2021-10-06 at 00:21 -0500, Ron wrote: > > What version of Postgresql do you think has the bug? > Where did you get the Postgresql binaries from? > What platform? FreeBSD pkg install postgresql ... Version 13.3 a friend use Debian unstable with PG version 14 and have the same problem. > > On 10/5/21 10:50 PM, ml@ft-c.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 > > > > > > >