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 1mXzPX-0001vC-0c for pgsql-general@arkaria.postgresql.org; Wed, 06 Oct 2021 05:24:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mXzPW-00080F-0A for pgsql-general@arkaria.postgresql.org; Wed, 06 Oct 2021 05:24:10 +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 1mXzMh-0000Xi-Bm for pgsql-general@lists.postgresql.org; Wed, 06 Oct 2021 05:21:15 +0000 Received: from mail-oi1-x22b.google.com ([2607:f8b0:4864:20::22b]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mXzMc-0001pW-GP for pgsql-general@lists.postgresql.org; Wed, 06 Oct 2021 05:21:14 +0000 Received: by mail-oi1-x22b.google.com with SMTP id a3so2414154oid.6 for ; Tue, 05 Oct 2021 22:21:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=eRq4d+C9sZNmo3f927+b2YxykLRv1kLLsK2SGo7c93s=; b=jojZc0IEsKQaROC0gUvV+jJ2YQRhQUgfwxnW+8xlOqp1D3MNclNQYUmeF57lr7EYq2 irfiRLy3RgQEeushfAvcNpLAu+BybuAjKF2DaMWTQ1IxLdhoZoCaKthhcI5l8igNZOBx eB6rIzVcGsrXf62udOdbHKZ8PouaH0vTqMUEXvMjZR55M5hhOJXIMYhIQi84wZzsA50G lGMsK94Gf6BcoyKuXcq07ehuP9P7apCaTIdk0ShvVaiw7bpVStbVaxUkukORwS6w9s2O rAsuJNxO0MoL95OsUvHdrguYzrOlSl9J6+7Qio6mctqKKFf//PmBoFGzWX+vh0JdeaRz F+qQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=eRq4d+C9sZNmo3f927+b2YxykLRv1kLLsK2SGo7c93s=; b=Jt42P02wcZo79bZNRARcdPa2csEbuewXPYFevuWZvzyTG+C9+qWdQbm5aadFQS4F7V acl+kMpeFtuQCcD8f16Dk8DhPnKQ7pxChYLcQAw1gjVzKnkmd4ftNxtLwDtryuZuCETX Nfz9v60eGLHDbvIe1EoeXn3UouNd6/SvZFBTIgAj9YpAp05I0A1u0prGRzPUhkNW500t +i9ovegXX0ynwK9FrbnlXQhtOa88iSIxvnQspmoHk0jfu4yY5qyJnYBpOkaDMu1l6941 WyJBtr8lfzymbh0mtgXFrh9dxsNZEZXfCpQB60j+/0uzSp++yDgmzHoHrrPO83jyhC3i IFuw== X-Gm-Message-State: AOAM53047UyrDf7St/VlBe5nsNWTZLJaGz8QXLrkfMKwWYA49i5m9p7d dN43QPRlhDtAmZtHvtYSNkUHiz7zlPw= X-Google-Smtp-Source: ABdhPJxXUPGXcUgiWSrk9+qTwdPojun4jwia3ad2sdZWu4odZ2XVXqI8oDrVPejhIvjq8l1QnX8olw== X-Received: by 2002:a54:4493:: with SMTP id v19mr523546oiv.177.1633497669621; Tue, 05 Oct 2021 22:21:09 -0700 (PDT) Received: from [192.168.88.10] (ip68-11-68-85.no.no.cox.net. [68.11.68.85]) by smtp.googlemail.com with ESMTPSA id c27sm602108otu.37.2021.10.05.22.21.08 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 05 Oct 2021 22:21:08 -0700 (PDT) Subject: Re: type bug? To: pgsql-general@lists.postgresql.org References: <108585f3e84fc2f98e7ab7776d745ca32b7c6dc1.camel@ft-c.de> From: Ron Message-ID: <5ab20c6a-f8d0-43e8-09c3-ef670c350739@gmail.com> Date: Wed, 6 Oct 2021 00:21:07 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <108585f3e84fc2f98e7ab7776d745ca32b7c6dc1.camel@ft-c.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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@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 > > > -- Angular momentum makes the world go 'round.