Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ehFrj-0007d7-N1 for pgsql-hackers@arkaria.postgresql.org; Thu, 01 Feb 2018 14:29:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ehFrh-0004ux-EN for pgsql-hackers@arkaria.postgresql.org; Thu, 01 Feb 2018 14:29:25 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ehFrh-0004un-7k for pgsql-hackers@lists.postgresql.org; Thu, 01 Feb 2018 14:29:25 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ehFrV-0005qy-7x for pgsql-hackers@postgresql.org; Thu, 01 Feb 2018 14:29:21 +0000 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 7E8D4208B8; Thu, 1 Feb 2018 09:29:10 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute7.internal (MEProxy); Thu, 01 Feb 2018 09:29:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=HXwjPQ 1K9COERIODAdwgO358ZSZx7xDYoAcwhgwsOC4=; b=PLFRY52lzfMq16T7Hq49cL ftlQtjV9hLax8DHrRAJgg20UJZ02sp9hcWXPzZ6VkfipD27pcC8IaLtQGietSIMj g56HlsGqHmaan66PsKgsfzKJ2Hr3mj6g9SAR6b/WximZxOJdmCkg5p9KGkNIpWci ePsgyhGy4wOtbJnUPh2Uxhp0LjyR79pBZs8b6mtx+oi5NiXvU0LBoh4pYfOld8zc lHGk+YWk0SvqFDMgmobLWqU11ZefUjZMt9vDo73bEGEhmt2vCsiezg+XJcbRc9Uz 3DqWAGbcno0oGA6Uj6me3Bh91QGSy1/X1QKZP8sYcrLtoMy2L+oXomXF03Xeq9TQ == X-ME-Sender: Received: from april.local (c-73-13-66-39.hsd1.pa.comcast.net [73.13.66.39]) by mail.messagingengine.com (Postfix) with ESMTPA id 2E0E97E3FA; Thu, 1 Feb 2018 09:29:10 -0500 (EST) Subject: Re: [HACKERS] generated columns To: Michael Paquier References: <1bc948f8-3bab-6c54-50af-c0723a75b85f@2ndquadrant.com> <20180116063546.GA3679@paquier.xyz> <48502d9b-60c4-5b10-40a2-e34f562132b4@2ndquadrant.com> <20180119051804.GC12826@paquier.xyz> <2e3d5147-16f8-af0f-00ab-4c72cafc896f@2ndquadrant.com> <20180131131804.GB1586@paquier.xyz> Cc: Jaime Casanova , pgsql-hackers From: Peter Eisentraut Organization: 2ndQuadrant Message-ID: Date: Thu, 1 Feb 2018 09:29:09 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <20180131131804.GB1586@paquier.xyz> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 1/31/18 08:18, Michael Paquier wrote: >> This also raises a question how a row type with generated columns should >> behave. I think a generation expression is a property of a table, so it >> does not apply in a row type. (Just like a default is a property of a >> table and does not apply in row types.) > > Hm. Identity columns and default columns are part of rowtypes. STORED > columns can alsobe part of a row type with little effort, so in order to > be consistent with the all the existing behaviors, it seems to me that > virtually-generated columns should be part of it as well. I have > compiled in the attached SQL file how things behave with your > patch. Only virtually-generated columns show a blank value. > > A empty value is unhelpful for the user, which brings a couple of > possible approaches: > 1) Make virtual columns part of a row type, which would make it > consistent with all the other types. That would be nice. I'm going to study this some more to see what can be done. -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services