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 1v10yZ-003bEp-53 for pgsql-docs@arkaria.postgresql.org; Tue, 23 Sep 2025 11:14:27 +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 1v10yX-00579J-RS for pgsql-docs@arkaria.postgresql.org; Tue, 23 Sep 2025 11:14:25 +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 1v10yX-005794-KE for pgsql-docs@lists.postgresql.org; Tue, 23 Sep 2025 11:14:25 +0000 Received: from mail-lj1-x235.google.com ([2a00:1450:4864:20::235]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1v10yT-002MYW-2H for pgsql-docs@lists.postgresql.org; Tue, 23 Sep 2025 11:14:25 +0000 Received: by mail-lj1-x235.google.com with SMTP id 38308e7fff4ca-36a53fe7ebdso20708921fa.1 for ; Tue, 23 Sep 2025 04:14:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1758626062; x=1759230862; darn=lists.postgresql.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=KWp2GirRUreqWk5OHTaXVhHHR8BpWrqXdDyClAUfJ3Q=; b=FH9C3P4MVAL1zIV5fNhxPsf1w0jhdmIuTwLQ3eanl5fNgKzy6qA912KsH8CMyiRZmj OR8jbKgoR9Gmzo7kv0J8bkLzHmhmn1qz7ZnmJfR6pnsy3tWCi9poEEcYDOuBb2V/Q2yv 9r2ZsYS6KR4fyw0KPXLR1MB27O4mz/TF9BaWzET0TGncdV8h8AWrF5dsvbz7kZMeloE4 hZlZoaUgFyiD6D20Q/B9pb9GYt+DG5n9vOXtc6E57+36TlPO17aivwoo2WTFUmAyGkgf j1Z4rCYfpFGauSwoEGJndXq6JnAEJ3BKSJrrUsmvpgkj2EI6V6ENAxcTlVSjOqsG/U4r m5rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1758626062; x=1759230862; h=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=KWp2GirRUreqWk5OHTaXVhHHR8BpWrqXdDyClAUfJ3Q=; b=lJeJPlJQgC+qHD0R7UhTTTYgu8N73YtXdMdFgoeldB3Yun2Nasli8/7Ncf4HIKD1RH kcZTd8NmHTlvd+pxTm5FLT1+b548l9PTg9f7OrazDAlgnNo7LEDxc8X+qzesf/D9ky2y bOq0LTOMhB/MMAvf1GGs+a3RzIwTQckaMzeKjhQNyBmLVKYBnxP2L5mDwnLZN/4wqsJU YKKPoCkPvOyuRfZyqmKgOfeBJDvBY6PEtl5Zxi4Wi4hgV4vNHjaWcM9krATmS3FJhoPk tVuBhuE56nwnAwB98nUiE2LuNjwzQrC2kY891f2KBFTk78dMTFjaKU6ll9234jichrmi zv4w== X-Forwarded-Encrypted: i=1; AJvYcCXmFeSap3ibQZP9w4k0Wm8dqg9celkAmnUDrfXb+uafBKLDwaNB7g9wjAucAwuLwP4DuCBcAEZNDw9L@lists.postgresql.org X-Gm-Message-State: AOJu0YyAaFcXlnZ58VwhVkunGeEXl0rgXf7AxreNbCWhDrN231BgJrq4 AOvVOYwUvjQMDxMHAbzdy+NNWahakg0cheKMbmqUbPpIU6Jt24cxLVaOB3b23VZ+pf+a3d2yhiY qLiC/ILr5K2wKYEB7eAkgm97oYbCiwBA6iA== X-Gm-Gg: ASbGncs1EE1JYK5Ap0dvBTrLxlCfGaQENwC/2fjHzbC23PLkKqGbJve1Bhya4Vx2OIr UbTb6ovV3fivH0GloQ7cKmWzcPEqhZc18fF1mUSVdmWJBSaztLfFkdH9B5etuSv9HA3wKKUiscf 3pHml9ZLYlD/huSfoRzXHvSdx0lO9UosGbdW0jLejBl6aG+gtU1cVBapDoC7FQNPh/pUXVT037L CqzMWB2DO84QYcJilXyi0SiZaUGWlvT8ysJ8cT+gg== X-Google-Smtp-Source: AGHT+IHNIm12L79cGWVYFUL3lrHpVPyzTaIod+a47WPI9G+is3j97xGDstHeNCvSAjEFlXNVvquXRYNIF9CLMObnJos= X-Received: by 2002:a05:651c:234d:20b0:35f:ddb1:96c1 with SMTP id 38308e7fff4ca-36d170fa692mr4816021fa.21.1758626062042; Tue, 23 Sep 2025 04:14:22 -0700 (PDT) MIME-Version: 1.0 References: <175861138289.858.2065605212405176332@wrigleys.postgresql.org> In-Reply-To: <175861138289.858.2065605212405176332@wrigleys.postgresql.org> From: David Rowley Date: Tue, 23 Sep 2025 23:14:10 +1200 X-Gm-Features: AS18NWBd7B5yxbpGiRwn4krPhyAqa8v8a6497jHPxNAkzpaJRzA6Om2wmQsG448 Message-ID: Subject: Re: Confusion in section 8.7.3. Type Safety To: dejan.spasic@bitweise.biz, pgsql-docs@lists.postgresql.org Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, 23 Sept 2025 at 20:59, PG Doc comments form wrote: > Page: https://www.postgresql.org/docs/17/datatype-enum.html > Description: > > In section 8.7.3. Type Safety one can observe a the following statement in > the examples. > > INSERT INTO holidays(num_weeks,happiness) VALUES (2, 'sad'); > > This is somewhat confusing since type happiness doesn't contain 'sad'. I > would suggest to remove the statement or to add an enum 'sad' in type > happiness. Thank you for the report. I think you might have missed that this section is demonstrating that the statement does not work due to the column's type not containing an enum value for 'sad' and that enum values are specific to the particular enum, rather than global to all enum types, as one *could* have assumed. Your proposed modification would make the bogus INSERT statement work, which would defeat the purpose of the section demonstrating that it doesn't work. David