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 1sOIG9-00DVbE-NF for pgsql-hackers@arkaria.postgresql.org; Mon, 01 Jul 2024 14:44:01 +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 1sOIG7-002aSa-CI for pgsql-hackers@arkaria.postgresql.org; Mon, 01 Jul 2024 14:43:59 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sOIG7-002aRw-2o for pgsql-hackers@lists.postgresql.org; Mon, 01 Jul 2024 14:43:59 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sOIG5-0042v2-0z for pgsql-hackers@postgresql.org; Mon, 01 Jul 2024 14:43:58 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 461EhrBo2739274; Mon, 1 Jul 2024 10:43:53 -0400 From: Tom Lane To: Peter Eisentraut cc: David Rowley , "David G. Johnston" , James Coleman , pgsql-hackers Subject: Re: Should we document how column DEFAULT expressions work? In-reply-to: References: <1362410.1719349169@sss.pgh.pa.us> <1390099.1719357084@sss.pgh.pa.us> <1642803.1719447063@sss.pgh.pa.us> Comments: In-reply-to Peter Eisentraut message dated "Mon, 01 Jul 2024 16:26:22 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2739272.1719845033.1@sss.pgh.pa.us> Date: Mon, 01 Jul 2024 10:43:53 -0400 Message-ID: <2739273.1719845033@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Peter Eisentraut writes: > On 01.07.24 01:54, David Rowley wrote: >> 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? That's not a very useful argument to make. What percentage of the SQL language as a whole is legacy cruft that we'd do differently if we could? I think the answer is depressingly high. Adding more special-purpose features to the ones already there doesn't move that needle in a desirable direction. I'd be more excited about this discussion if I didn't think that the chances of removing 'now'::timestamp are exactly zero. You can't just delete useful decades-old features, whether there's a better way or not. regards, tom lane