From: ml@ft-c.de
To: pgsql-general@lists.postgresql.org
Subject: Re: type bug?
Date: Wed, 06 Oct 2021 08:02:50 +0200
Message-ID: <c07e84b99e919373c8d1e920d208b9522ef983f0.camel@ft-c.de> (raw)
In-Reply-To: <5ab20c6a-f8d0-43e8-09c3-ef670c350739@gmail.com>
References: <108585f3e84fc2f98e7ab7776d745ca32b7c6dc1.camel@ft-c.de>
<5ab20c6a-f8d0-43e8-09c3-ef670c350739@gmail.com>
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
> >
> >
> >
>
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-general@postgresql.org
Cc: ml@ft-c.de
Subject: Re: type bug?
In-Reply-To: <c07e84b99e919373c8d1e920d208b9522ef983f0.camel@ft-c.de>
References: <108585f3e84fc2f98e7ab7776d745ca32b7c6dc1.camel@ft-c.de> <5ab20c6a-f8d0-43e8-09c3-ef670c350739@gmail.com> <c07e84b99e919373c8d1e920d208b9522ef983f0.camel@ft-c.de>
* 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