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 1sMSov-002X5a-8K for pgsql-hackers@arkaria.postgresql.org; Wed, 26 Jun 2024 13:36:21 +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 1sMSos-004Zzw-Pd for pgsql-hackers@arkaria.postgresql.org; Wed, 26 Jun 2024 13:36:19 +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 1sMSor-004Zzo-RT for pgsql-hackers@lists.postgresql.org; Wed, 26 Jun 2024 13:36:18 +0000 Received: from fout8-smtp.messagingengine.com ([103.168.172.151]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sMSoo-003EPv-Qy for pgsql-hackers@postgresql.org; Wed, 26 Jun 2024 13:36:16 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailfout.nyi.internal (Postfix) with ESMTP id 2BBBD1380063; Wed, 26 Jun 2024 09:36:13 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Wed, 26 Jun 2024 09:36:13 -0400 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 :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1719408973; x= 1719495373; bh=jiD5YQsaT+oKbV2lsExToP5zZFgjBRuKE1v3v5Z443U=; b=M zt8VmavnJE59Cdt6sGbc0tPAsEnGcI8QLoJ3YOJ80njtNgqFt3pDCGhBcFkH4FrJ K5+x5353Dn+1knIStPo4ZgAqH8zDvGqgqvoXOnsuxWzfoZQbOfyyubiKBVoabYY1 /aFTLabB6N0Od29SS6jlEpyb6SAU9h+nfdxaOuGams114RgNoUROA6703SAo0J53 0uo+7VdSoSw2HEBIpKiRlrR5UNlu0sE1ol7hM8GoaaL/8gX8Ji6+ROxoMnrmWY8o JXlzlBd4S5oU1gFokXF47EpUpTdwTZV62QVHKqwIbt6gG2g5qSNvxyoUfVL+6b78 mq12ff8hreiYcxDi0eWEA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrtddvgdeiiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfggtggugfgjsehtkeertddttdejnecuhfhrohhmpeetlhhvrghr ohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgqe enucggtffrrghtthgvrhhnpedvkedtffduffdtffffheffhfejjefhgfeiueeukeejkeff gfdufffhudffffeuveenucffohhmrghinhepvghnthgvrhhprhhishgvuggsrdgtohhmne cuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhh vghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 26 Jun 2024 09:36:12 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1719408970; bh=4Gn2/6Ym7kNTxBezV+5un0AN/7sAWjEMbCPvNJkPEek=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=gS+834G/rh8HA2OEWLbFYLY6Mmz6HIqwpYnofnxV4wIijoxG49Zhfy8IWqlsfXkxH QapjqktNDkfK+tI2i6JjaXlBfrc0Ug7hG4W1dXsJcACo6Mm7ju86G8NJ2yyktLAzdd hurVogGHpcN0pbMTW07qXGbfLxkWH9dmPEibxT9FxrFau7763MuZeEEPyeit1ed/Zq SGBb3+CBR5ICF/bnGNN/hTQ0z2kNxX3UEGn/ETD/IW0xY4IbBt9eh1J2MJSzb5wteg Sg6A3GbrEjStY9RQ2Slb/gXZwPaPWEP9wUUxMJWRuU/SZrzOsnvdJDYEsFO6U3Eal5 9PhVPk8Hctp3g== Received: by schmee.alvh.no-ip.org (Postfix, from userid 1000) id 1F6CC527; Wed, 26 Jun 2024 06:36:10 -0700 (PDT) Date: Wed, 26 Jun 2024 15:36:10 +0200 From: Alvaro Herrera To: "David G. Johnston" Cc: David Rowley , Tom Lane , James Coleman , pgsql-hackers Subject: Re: Should we document how column DEFAULT expressions work? Message-ID: <202406261336.j6nwh25eelo6@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2024-Jun-25, David G. Johnston wrote: > On Tue, Jun 25, 2024 at 9:50 PM David Rowley wrote: > > FWIW, I disagree that we need to write anything about that in this > > part of the documentation. I think any argument for doing this could > > equally be applied to something like re-iterating what the operator > > precedence rules for arithmetic are, and I don't think that should be > > mentioned. > > I disagree on this equivalence. The time literals are clear deviations > from expected behavior. Knowing operator precedence rules, they apply > everywhere equally. And we should document the deviations directly where > they happen. Even if it's just a short link back to the source that > describes the deviation. I'm fine with something less verbose pointing > only to the data types page, but not with nothing. I agree that it'd be good to have _something_ -- the other stance seems super unhelpful. "We're not going to spend two lines to explain some funny rules that determine surprising behavior here, because we assume you have read all of our other 3000 pages of almost impenetrably dense documentation" is not great from a user's point of view. The behavior of 'now' in DEFAULT clauses is something that has been asked about for decades. Arithmetic precedence is a terrible straw man argument. Let's put that aside. -- Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/ "If it is not right, do not do it. If it is not true, do not say it." (Marcus Aurelius, Meditations)