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 1v15Lr-004P00-Uh for pgsql-docs@arkaria.postgresql.org; Tue, 23 Sep 2025 15:54:48 +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 1v15Lq-006kvj-Fn for pgsql-docs@arkaria.postgresql.org; Tue, 23 Sep 2025 15:54:46 +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 1v13BM-005gBh-6t for pgsql-docs@lists.postgresql.org; Tue, 23 Sep 2025 13:35:48 +0000 Received: from mail-yw1-x1132.google.com ([2607:f8b0:4864:20::1132]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1v13BJ-001wcg-28 for pgsql-docs@lists.postgresql.org; Tue, 23 Sep 2025 13:35:47 +0000 Received: by mail-yw1-x1132.google.com with SMTP id 00721157ae682-71d6083cc69so56431927b3.2 for ; Tue, 23 Sep 2025 06:35:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bitweise-biz.20230601.gappssmtp.com; s=20230601; t=1758634545; x=1759239345; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Z3vKVzB0mw9JwZVgr+9mCWtDDClH3hyANiZ+vVvgitM=; b=C8rgfB0Yg34FcQv4HdFBnzorPJtDGKdC/Po9TyVMOeMRxn1sJg9blP5aUOzeeskZS+ a3ImOPGao0Oo20sXyY5Kdz+Z6BzLc0Le3OiTK3j25I0Qs1hrIoEUMafgFsd63k7JzELS EZxxfye8/EdAeMSzQ68yF3Kk1BulrRszKQb9QzX4Kygazc63kjRDvmW/uWlFvF0sHIVH 1iWON+8C59ndpj+IDVjIbOVeX5Yb4u5BbvaT2dkSJbWyQLLjbosqwI8G2bZIqm/0+mdf SEfSTIm1hY4Z7o/jas0KP1os/w2ujVatnX3lvFgcidMJ0p5NjILyrgJmUeRl3tOjH5zH 4LgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1758634545; x=1759239345; h=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=Z3vKVzB0mw9JwZVgr+9mCWtDDClH3hyANiZ+vVvgitM=; b=hM2gaeyslcaht+QVPhH+85ISc4mjuGKA+/cZtUjQqAIxtkxhmvkyiqD1QR+xGbi6Gx Vt6VR/EDnodzeNMUaEGNw+K42onQx2KXcIZx4+tMlIkaUzH+1JuH0Orfe4C60xDd3DYk LtKaVQUZEtdAp/0gc0xzzMYuDcip8Q7bjkHOl2TkAJ4SAnBgEhlVYWlxi9yOd8y+ITWB qrURteWmb2x9FPsSVepOlBX1KNtVV3fGERTy+d8uLaVsOQY9S8VFLA8bX9+p+PuhYoS1 SaWIm/3aZRwmqLcwORebRELiuOM+IgP+Q59bH9xvdSVCSPGun7NRlnWpml1/UbCu7QaK /CNg== X-Gm-Message-State: AOJu0Yzro/UoJ1THFdUA25IkjIsArf1p/KwE8DZMzYxpcwn/0EBysGZ3 U2S1wF+uZ+7ckGANYmvuOvLLJN7Pii9bNxUcoUUwq8Li/0xIyc93peNZG0kZBHAoxsd6XBeRsxL EI2rhjZSyJT8WGvu3apuP+rasv/vWfVEzCNtZS1KFdw== X-Gm-Gg: ASbGncsoZZsMrgOzUCRWtP3skEsp83IGtU27rfhZYI/CQXiSAirX5fN5h2UuIztRvdL 1lLJt055N6ipXxtDaKoBa4SkRDjoZSSOUTdHa2OFncIwARI9WpMq4a8IPTC+J1vKtBejB4dY6q4 jbnVsHjaRUDS/U29DBGgeyeT9XlXaKeLjRY+zENWY+HfM79YveUzglOWHtgZRMQTR5jJLDMEGsg diUjf0yLUtYvxjEbnMEqkGsfK48JoyMcT8L/iJZBh5MwZE= X-Google-Smtp-Source: AGHT+IErVPm/8HJHYBjmwvPM9NDegLbACIx6o9eUpwdaO5i0HQwl/6oBQM178pfTlkaNzDTI4p1xUyh08hrxri14icU= X-Received: by 2002:a05:690c:6b83:b0:720:c20:dc29 with SMTP id 00721157ae682-758a717b812mr17912267b3.51.1758634543969; Tue, 23 Sep 2025 06:35:43 -0700 (PDT) MIME-Version: 1.0 References: <175861138289.858.2065605212405176332@wrigleys.postgresql.org> In-Reply-To: From: Dejan Spasic Date: Tue, 23 Sep 2025 15:35:32 +0200 X-Gm-Features: AS18NWASXPNZMBnLbNrlwEFcrruQ8N-SbJYEeQBPgK_Udojs_ltWWkrrqQhmQxc Message-ID: Subject: Re: Confusion in section 8.7.3. Type Safety To: David Rowley Cc: pgsql-docs@lists.postgresql.org Content-Type: multipart/alternative; boundary="000000000000488d54063f7803fe" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000488d54063f7803fe Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Yes, you are right. Thanks for the fast feedback. BitWeise Erkrather Stra=C3=9Fe 304 D-40231 D=C3=BCsseldorf Tel.: +49.151 2915 88 99 E-Mail: dejan.spasic@bitweise.biz WWW: http://www.bitweise.biz On Tue, Sep 23, 2025, 1:14=E2=80=AFPM David Rowley w= rote: > 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 > --000000000000488d54063f7803fe Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Yes, you are right. Thanks for the fast feedback.

= BitWeise
Erkrather Stra=C3=9Fe 304
D-40231 D=C3=BCsseldorf
Tel.: +49.151 2915 88 99

On Tue, = Sep 23, 2025, 1:14=E2=80=AFPM David Rowley <dgrowleyml@gmail.com> wrote:
On Tue, 23 Sept 2025 at 20:59, PG Doc comments form
<noreply@postgresql.org> wrote:
> Page: https://www.postgresql.or= g/docs/17/datatype-enum.html
> Description:
>
> In section 8.7.3. Type Safety one can observe a the following statemen= t in
> the examples.
>
> INSERT INTO holidays(num_weeks,happiness) VALUES (2, 'sad'); >
> This is somewhat confusing since type happiness doesn't contain &#= 39;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 e= num
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
--000000000000488d54063f7803fe--