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 1sMD8P-0017tL-PP for pgsql-hackers@arkaria.postgresql.org; Tue, 25 Jun 2024 20:51:25 +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 1sMD8O-000Xdh-4A for pgsql-hackers@arkaria.postgresql.org; Tue, 25 Jun 2024 20:51:24 +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 1sMD8N-000XdZ-Od for pgsql-hackers@lists.postgresql.org; Tue, 25 Jun 2024 20:51:24 +0000 Received: from mail-lj1-x231.google.com ([2a00:1450:4864:20::231]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sMD8L-003XfD-O3 for pgsql-hackers@postgresql.org; Tue, 25 Jun 2024 20:51:23 +0000 Received: by mail-lj1-x231.google.com with SMTP id 38308e7fff4ca-2ec002caf3eso90126421fa.1 for ; Tue, 25 Jun 2024 13:51:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719348679; x=1719953479; darn=postgresql.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=ZinqZARj736uMtTIkTu3cSX4sWo0i28++Pilw7whWc8=; b=FsRfnNORwW6t01kZlW7D/sQZFd13+uTZ/j6+StEPx4m32uAMITFuUhIrQkOxl4IsqL uomD0nd5D3GjazCa7X1UaKyRs2ux31TIRO5sOnRikKaY9y8jcWr5N5iz1SHwQgH/WdP5 PV3PLagWYUYB8xS8JR2HGDoN7mNgmY6N8pqkaWfJiqk2OWu//yzWUlNfl/vIKFe2AFJY bw0IQtSpkFXkOMTDwT91lVcUMkeQg7rO/xs/E/sV49Zbx7LMM81Wc2KuK+a97KIraw+a 20qpT7MCcGhrdIAM6pMnAbbPXUhBG5lvVQB8j1tVk8DrkzLGusr8hn2J/PyZVyHvYV+1 3lsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719348679; x=1719953479; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=ZinqZARj736uMtTIkTu3cSX4sWo0i28++Pilw7whWc8=; b=li6SKtiUzSrZREkL4/2RsF54OS+5bLDhdG2YQHnP3hGUUoISkTxHknNMPBTYU4e2Y6 86nLP0WFb18K+KBnBpQX8qGbmZkj4p+M7IuVR5d7sq/AD18DjtnXFfhNU16MKzzLtf9L yoWe/Gs2jBfSy5losc1B394b0yIISvpSVLYA6AhvZA4C/wBXE6eSKRbIP7+TEOZZk/Dp qMsL5HBczBGDV1UXo/NxGu77eSpx1bl6qAcNXDLzevSmRfzWjf0bVnYN1JbCbNHsPvyW nbnAiv10hmHOK+/pMOYwVN1dJsGTHFzbbT76pk8l+xxh0Hhsy3BFovC5PSzjqqhqdy7q e0Eg== X-Gm-Message-State: AOJu0YzIQ7Z9SHsnon0/vci9MUIu3bOdr0zr4GDQhFSdw2ezr14qgAoS +TiekpGI02SRbKQZiGTgMJZ0FgPQe83UhI8zd2M2Y7KVa4raZ2cw1Zkg+XTiT3++s8hd7r4zpY/ dK4Op4MGw1UDbs9B/8jPiEQagyiqniA== X-Google-Smtp-Source: AGHT+IHdiyjwPZpZ159i2mz82c56Y+nZySDIM4Uihh+9Db747IA/9cR/KjohloE5nXIop1AkgYmj111QFA9QeHgzUtU= X-Received: by 2002:a2e:9b97:0:b0:2ec:5258:e889 with SMTP id 38308e7fff4ca-2ec5b339cb7mr63031581fa.46.1719348678195; Tue, 25 Jun 2024 13:51:18 -0700 (PDT) MIME-Version: 1.0 From: James Coleman Date: Tue, 25 Jun 2024 16:51:05 -0400 Message-ID: Subject: Should we document how column DEFAULT expressions work? To: pgsql-hackers Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello, It's possible I'm the only one who's been in this situation, but I've multiple times found myself explaining to a user how column DEFAULT expressions work: namely how the quoting on an expression following the keyword DEFAULT controls whether or not the expression is evaluated at the time of the DDL statement or at the time of an insertion. In my experience this is non-obvious to users, and the quoting makes a big difference. Is this something that we should document explicitly? I don't see it called out in the CREATE TABLE reference page, but it's possible I'm missing something. Thanks, James Coleman