Recent submissions

Comment · 3 years ago
I don't like this approach much because getting cryptic integers when you do a `SELECT` in the database is really cumbersome.
Comment · 3 years ago
An enum stores a small reference to the enum value in the tuples, and the constraint approach stores the string itself. The constraint approach takes more space with (a) larger enum values, (b) more columns using them, and (c) more rows in the tables that use them. The difference depends on the characteristics of the database we're talking about.
Comment · 3 years ago
> Is there a reason ALTER TYPE name ADD VALUE new_enum_value wouldn't Just Work for the first example for 99% of use cases?

I'm sorry, we don't have any examples in the article about adding values to enums, so I don't know to what you are referring here.

> Yes, that's true, but also very rare?

It is rare, indeed, but we just have a strong inclination towards having a clean schema, so we do prefer to clean up things that would otherwise be unused. But I understand that many people would prefer to leave them hanging there, even if they are not going to be used in any way.

Comment · 3 years ago
That would be an improvement on the `CHECK` constraint approach if the same `CHECK` constraint is used in multiple columns, to DRY it up. The `DOMAIN` types offer the same commands for `CHECK` constraints, namely `NOT VALID` when updating the constraint, and `VALIDATE CONSTRAINT` to make sure it is valid after having updated it.
Comment · 7 years ago
Comment · 7 years ago
This is something I really want to implement in 2019: a routine, and a general attitude, strategy, tactics and actions to "get my act together".
Comment · 9 years ago
"Mindset: The New Psychology of Success". By Carol Dweck, PhD. This is a game-changer. It taught me what we believe is what really defines what we can or cannot do.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton