Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Use an "Optional<integer>" column instead. Doesn't you RDBMS have the notion of "Optional"? There's the disaster!


Truly relational systems support relation-valued attributes and those are the perfect means to support Optional<anything> in a database.


What does a "relation-valued attribute" have in e.g. the "birthdate" column when we don't know the customer's birthdate? Is it... null?


IIUC, the parent is suggesting that you have a user table with a birthdate column which is itself a table with either no rows or one row.


I suspect you've done a bit of steelmanning here. Thanks though, as parent had been unable to come up with this short explanation despite writing a dozen vague-but-vitriolic posts. Perhaps he'll take note for next time he crawls out from under his rock.

I wonder, if one were to query the DB, what would show up in the "birthdate table" column? I'm kind of hoping it would be zero, which would in turn be interpreted as the epoch, but sadly it would probably be null...


> I suspect you've done a bit of steelmanning here.

Not deliberately, perhaps reflexively. It just seemed the most straightforward (and interesting) interpretation of the comment in question. I hadn't seen the other comments.

> I wonder, if one were to query the DB, what would show up in the "birthdate table" column?

As I understand it, what would show up in the "birthdate table" column is a table. You would have to do a select on that table to get actual data out, and in that select you'd get either zero or one row returned.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: