public inbox for [email protected]  
help / color / mirror / Atom feed
Confusion in section 8.7.3. Type Safety
3+ messages / 3 participants
[nested] [flat]

* Confusion in section 8.7.3. Type Safety
@ 2025-09-23 07:09 PG Doc comments form <[email protected]>
  2025-09-23 11:14 ` Re: Confusion in section 8.7.3. Type Safety David Rowley <[email protected]>
  0 siblings, 1 reply; 3+ messages in thread

From: PG Doc comments form @ 2025-09-23 07:09 UTC (permalink / raw)
  To: [email protected]; +Cc: [email protected]

The following documentation comment has been logged on the website:

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.


^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Confusion in section 8.7.3. Type Safety
  2025-09-23 07:09 Confusion in section 8.7.3. Type Safety PG Doc comments form <[email protected]>
@ 2025-09-23 11:14 ` David Rowley <[email protected]>
  2025-09-23 13:35   ` Re: Confusion in section 8.7.3. Type Safety Dejan Spasic <[email protected]>
  0 siblings, 1 reply; 3+ messages in thread

From: David Rowley @ 2025-09-23 11:14 UTC (permalink / raw)
  To: [email protected]; [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





^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Confusion in section 8.7.3. Type Safety
  2025-09-23 07:09 Confusion in section 8.7.3. Type Safety PG Doc comments form <[email protected]>
  2025-09-23 11:14 ` Re: Confusion in section 8.7.3. Type Safety David Rowley <[email protected]>
@ 2025-09-23 13:35   ` Dejan Spasic <[email protected]>
  0 siblings, 0 replies; 3+ messages in thread

From: Dejan Spasic @ 2025-09-23 13:35 UTC (permalink / raw)
  To: David Rowley <[email protected]>; +Cc: [email protected]

Yes, you are right. Thanks for the fast feedback.

BitWeise
Erkrather Straße 304
D-40231 Düsseldorf
Tel.: +49.151 2915 88 99
E-Mail: [email protected]
WWW: http://www.bitweise.biz

On Tue, Sep 23, 2025, 1:14 PM David Rowley <[email protected]> wrote:

> 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
>


^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2025-09-23 13:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-09-23 07:09 Confusion in section 8.7.3. Type Safety PG Doc comments form <[email protected]>
2025-09-23 11:14 ` David Rowley <[email protected]>
2025-09-23 13:35   ` Dejan Spasic <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox