Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sOHzH-00DU39-Kf for pgsql-hackers@arkaria.postgresql.org; Mon, 01 Jul 2024 14:26:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sOHzF-002CU2-NF for pgsql-hackers@arkaria.postgresql.org; Mon, 01 Jul 2024 14:26:34 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sOHzE-002CTX-C1 for pgsql-hackers@lists.postgresql.org; Mon, 01 Jul 2024 14:26:33 +0000 Received: from fout3-smtp.messagingengine.com ([103.168.172.146]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sOHzB-004Uz4-4A for pgsql-hackers@postgresql.org; Mon, 01 Jul 2024 14:26:32 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailfout.nyi.internal (Postfix) with ESMTP id 98CDD138028E; Mon, 1 Jul 2024 10:26:26 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Mon, 01 Jul 2024 10:26:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eisentraut.org; h=cc:cc:content-transfer-encoding:content-type:content-type :date:date:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:subject:subject:to:to; s=fm1; t=1719843986; x=1719930386; bh=VZjYwwlSPQzXoWGL0iWIJhY/x/SFk9qm axS6R7E+H44=; b=L80uoOGV2LGFBhXqZPUQTHDwXTEmlVswdFP6lPTH8NIqIH5z k/wJNsJs07x64gn4vo9fqUQ0xOXZHv3U9hvRu+YLnGL23ub+KLdlRItMIjLa2064 udgvKGccB7Mthqy4Vxc0rOl11SoarQtyNjKXzqVA5JFkx5tUaITgUElJF7enjQOg yIVjm10t0BQXPNLr+MV2sM8ehdytMtgWB9W9klshOof65H9eNPWhjZRlIyyBkvFs JdVmkebnA6wYaKlYo6mHVU1WbZTUawyNA6i8pJ1BHnQlH6Y1FJoT4oEhhIVXcziu tdbRCBN9I28a7tSZs27ZwUMimmWbu1VwaY2ucg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1719843986; x= 1719930386; bh=VZjYwwlSPQzXoWGL0iWIJhY/x/SFk9qmaxS6R7E+H44=; b=f ZY6sbMumI8DZzxccSL82ioMmaSiT6/QSaWV/636cg3lS/jI2Cx95Ty8cqThyOaDS JB2oZcBrimmJPukvuiO0oX9ou1v/FusvfWZLKMpZ8j05reHz6qc9TGKSt4FNIX/+ WxpVoLdFYEerYSFq+2KReCqSPbgeI8ML4BElwU2Ju9MMM1B4Bg+y7PP1YucxiHCy 7tagYqatIhNj8EZz7mN26fy5ylA/3UFadQGk4fXn2ttWna/cmgrP9Xryd6PFA4Sj DUpWkMt7x1Lh6Iat5zCAsPcFee8hddu5G3+uNzLhHGmJtokfza07saTjG7mLT8yo QpqDZ4UE58H8D3htQQkPg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrudefgdejhecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefkffggfgfuvfevfhfhjggtgfesthejredttddvjeenucfhrhhomheprfgvthgv rhcugfhishgvnhhtrhgruhhtuceophgvthgvrhesvghishgvnhhtrhgruhhtrdhorhhgqe enucggtffrrghtthgvrhhnpefgjedthfekfedtuefgieelheetleejgefhueeltdfhueet vdffudekfeejhfegheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpehpvghtvghrsegvihhsvghnthhrrghuthdrohhrgh X-ME-Proxy: Feedback-ID: ie0a040ee:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 1 Jul 2024 10:26:25 -0400 (EDT) Message-ID: Date: Mon, 1 Jul 2024 16:26:22 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Should we document how column DEFAULT expressions work? To: David Rowley Cc: Tom Lane , "David G. Johnston" , James Coleman , pgsql-hackers References: <1362410.1719349169@sss.pgh.pa.us> <1390099.1719357084@sss.pgh.pa.us> <1642803.1719447063@sss.pgh.pa.us> Content-Language: en-US From: Peter Eisentraut In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 01.07.24 01:54, David Rowley wrote: > On Thu, 27 Jun 2024 at 23:57, Peter Eisentraut wrote: >> Maybe we should really be thinking about deprecating these special >> values and steering users more urgently toward more robust alternatives. >> >> Imagine if 'random' were a valid input value for numeric types. > > I think there are valid reasons to use the special timestamp input > values. One that I can think of is for use with partition pruning. If > you have a time-range partitioned table and want the planner to prune > the partitions rather than the executor, you could use > 'now'::timestamp in your queries to allow the planner to prune. Yeah, but is that a good user interface? Or is that just something that happens to work now with the pieces that happened to be there, rather than a really designed interface? Hypothetically, what would need to be done to make this work with now() or current_timestamp or something similar? Do we need a new stability level that somehow encompasses this behavior, so that the function call can be evaluated at planning time? > That > works providing that you never use that in combination with PREPARE > and never put the query with the WHERE clause inside a VIEW. And this kind of thing obviously makes this interface even worse.