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 1sQ24v-007WrA-On for pgsql-hackers@arkaria.postgresql.org; Sat, 06 Jul 2024 09:51:37 +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 1sQ24u-002HNn-3m for pgsql-hackers@arkaria.postgresql.org; Sat, 06 Jul 2024 09:51:36 +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 1sQ24t-002HNe-QM for pgsql-hackers@lists.postgresql.org; Sat, 06 Jul 2024 09:51:35 +0000 Received: from mail-pg1-x52a.google.com ([2607:f8b0:4864:20::52a]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sQ24r-000ge3-7c for pgsql-hackers@postgresql.org; Sat, 06 Jul 2024 09:51:34 +0000 Received: by mail-pg1-x52a.google.com with SMTP id 41be03b00d2f7-76cb5b6b3e4so220178a12.1 for ; Sat, 06 Jul 2024 02:51:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720259492; x=1720864292; darn=postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=o18Px31YEuZhKS6xCIvksD5zpkzJL/ynmA5DRAh7uQg=; b=Xgbc2xXSu9Sd/R62Bu2UiBjnndJwW2A03WYSyq0jFS8CYCVT2IOZOS6Pi1BG8ZuViT qdYqaeDA3HE1QnXSPQhKq8GCmia3OOqmpcVrOIwkeZd20T7mjlmmIZxdTezKcWgNUZ8r EFOpa0I+5aJMs/VDDox0vKtbbO1Khkkm3OgCVFCFifhYk9WfqV4DUN/gHkBUU8Ilgmz0 F0Ikrk+lEz44pLLLDc6+uoiXU6PpkYZYP5gIRpdKz+CVUF2l3PwxPJBKeaU9ImodLn43 ZVziSpI1kdRffj7RFZqlEvjYUiGf3Do1CRVOYn79AdDlRUkNatvJl89LAy8cP4Mq6H4/ q0zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720259492; x=1720864292; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=o18Px31YEuZhKS6xCIvksD5zpkzJL/ynmA5DRAh7uQg=; b=obzN/V3qmu7+3B/iMYD5RdWQ+bUcu2DYmc/yXA79UNTvKP/9knS5E1fzrq2VQslrj2 OLQA+lYqd1sUb6D/Lyw6xK6wtDCAvOUkj0mpAs9D2w0BEmsOr1ctL9/6+IsCRv81g8AD ieMrOZz1fN8Ew67+NOcRpY8W4mi9NrzYDH6CaTrUx2XABNb/fdEl4Pwh2eQIZ/NXzecf 4aeT4FFoAKamkA3POyC4AADKhFZcqc3eWlKqN1G66UQdCaulxxyaWAmZlQtGGBJ3M90p 7vjoBaUkEQv4kIPyBR4JFGkqnqDWBvSKjwMDJNZB2uXXGxByLQTdYRZ+vM4/A0xJXB+T XbHg== X-Forwarded-Encrypted: i=1; AJvYcCUbS84mHk89ccinyYoDBSj5WS7/Zr37F4Vj2X2wgtbMagHzL9x6TYVndOOYz89zjV5/Knpvgsuy1FbxgeFnoiTdX4Ay4aRYpGNH/6QE X-Gm-Message-State: AOJu0YwTC31WFiIDuzYI12VhG9XSRuOiUVzuZfj/t9/R6sARY0SwkMX2 rClkb/NWGnQZ5Nh/lPDTf97bObygMfqrhKziXp/2IRzCC0CAkiUoAkKjcMJWCXZ0ATL9zQonFOd fgm882obLLPBSm88DrxlujX9FIrI= X-Google-Smtp-Source: AGHT+IFmCGLyj6B6KncO6raPSQPCK2Y+SsR6x4DuUa0EAwhb8Loj8YRh9ESWMY2z+fo2QBL0daymU2s9MCmtBWXoeLU= X-Received: by 2002:a17:90b:f8e:b0:2c2:c2fe:77c5 with SMTP id 98e67ed59e1d1-2c99c81e9a7mr4498064a91.40.1720259491929; Sat, 06 Jul 2024 02:51:31 -0700 (PDT) MIME-Version: 1.0 References: <1362410.1719349169@sss.pgh.pa.us> <1390099.1719357084@sss.pgh.pa.us> <1642803.1719447063@sss.pgh.pa.us> In-Reply-To: <1642803.1719447063@sss.pgh.pa.us> From: Pantelis Theodosiou Date: Sat, 6 Jul 2024 10:51:20 +0100 Message-ID: Subject: Re: Should we document how column DEFAULT expressions work? To: Tom Lane Cc: David Rowley , "David G. Johnston" , James Coleman , pgsql-hackers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Jun 27, 2024 at 1:11=E2=80=AFAM Tom Lane wrote: > > David Rowley writes: > > Maybe I'm slow on the uptake, but I've yet to see anything here where > > time literals act in a special way DEFAULT constraints. This is why I > > couldn't understand why we should be adding documentation about this > > under CREATE TABLE. > > It's not that the parsing rules are any different: it's that in > ordinary DML queries, it seldom matters very much whether a > subexpression is evaluated at parse time versus run time. > In CREATE TABLE that difference is very in-your-face, so people > who haven't understood the rules clearly can get burnt. > > However, there are certainly other places where it matters, > such as queries in plpgsql functions. So I understand your > reluctance to go on about it in CREATE TABLE. At the same > time, I see where David J. is coming from. > > Maybe we could have a discussion of this in some single spot, > and link to it from CREATE TABLE and other relevant places? > ISTR there is something about it in the plpgsql doco already. > +1 to this idea.