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 1sMKxr-001mEA-LA for pgsql-hackers@arkaria.postgresql.org; Wed, 26 Jun 2024 05:13:03 +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 1sMKxq-0021OH-1f for pgsql-hackers@arkaria.postgresql.org; Wed, 26 Jun 2024 05:13:02 +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 1sMKxp-0021Ni-NV for pgsql-hackers@lists.postgresql.org; Wed, 26 Jun 2024 05:13:02 +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 1sMKxn-003AY1-Eq for pgsql-hackers@postgresql.org; Wed, 26 Jun 2024 05:13:00 +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 45Q5CvBh1437010; Wed, 26 Jun 2024 01:12:57 -0400 From: Tom Lane To: David Rowley cc: "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> Comments: In-reply-to David Rowley message dated "Wed, 26 Jun 2024 16:50:00 +1200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1437008.1719378777.1@sss.pgh.pa.us> Date: Wed, 26 Jun 2024 01:12:57 -0400 Message-ID: <1437009.1719378777@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk David Rowley writes: > If people don't properly understand these special timestamp input > values, then maybe the documentation in [1] needs to be improved. At > the moment the details are within parentheses. Namely "(In particular, > now and related strings are converted to a specific time value as soon > as they are read.)". Maybe it would be better to be more explicit > there and mention that these are special values that the input > function understands which are translated to actual timestamp values > when the type's input function is called. That could maybe be tied > into the DEFAULT clause documentation to mention that the input > function for constant values is called at DML time rather than DDL > time. That way, we're not adding these (unsustainable) special cases > to the documentation. This sounds like a reasonable approach to me for the magic-input-values issue. Do we want to do anything about nextval()? I guess if you hold your head at the correct angle, that's also a magic-input-value issue, in the sense that the question is when does regclass input get resolved. regards, tom lane