Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dxcl0-0003AY-GS for pgsql-bugs@arkaria.postgresql.org; Thu, 28 Sep 2017 17:37:54 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dxckz-0002fU-MX for pgsql-bugs@arkaria.postgresql.org; Thu, 28 Sep 2017 17:37:53 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dxckz-0002f0-13 for pgsql-bugs@postgresql.org; Thu, 28 Sep 2017 17:37:53 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dxcku-0004xT-BU for pgsql-bugs@postgresql.org; Thu, 28 Sep 2017 17:37:51 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id v8SHbjov001329; Thu, 28 Sep 2017 13:37:45 -0400 From: Tom Lane To: dvd@gnx.it cc: pgsql-bugs@postgresql.org Subject: Re: BUG #14834: quote_literal and composite types, different behaviour between sql and plpgsql In-reply-to: <20170928153517.28566.91850@wrigleys.postgresql.org> References: <20170928153517.28566.91850@wrigleys.postgresql.org> Comments: In-reply-to dvd@gnx.it message dated "Thu, 28 Sep 2017 15:35:17 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1327.1506620265.1@sss.pgh.pa.us> Date: Thu, 28 Sep 2017 13:37:45 -0400 Message-ID: <1328.1506620265@sss.pgh.pa.us> List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org dvd@gnx.it writes: > I found that `quote_literal` behaviour is wrong when used in a plpgsql > function over a null composite type, let me show: No, there's nothing wrong with quote_literal. Your example is showing that plpgsql converts a "null" composite value into a row-of-nulls, when dealing with a variable of a named composite type (in this case, the variable is the parameter "val"). This is arguably wrong, but plpgsql has been doing that for a mighty long time so people are hesitant to change it. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs