public inbox for [email protected]
help / color / mirror / Atom feedFrom: David Rowley <[email protected]>
To: [email protected]
To: [email protected]
Subject: Re: Confusion in section 8.7.3. Type Safety
Date: Tue, 23 Sep 2025 23:14:10 +1200
Message-ID: <CAApHDvptZTx5-m0-o5qijs96wOgcTaRE+JrLrxcP2JhRxteLmQ@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
On Tue, 23 Sept 2025 at 20:59, PG Doc comments form
<[email protected]> 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
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: Confusion in section 8.7.3. Type Safety
In-Reply-To: <CAApHDvptZTx5-m0-o5qijs96wOgcTaRE+JrLrxcP2JhRxteLmQ@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox