
Understanding the Power of Data Types - blondin
http://postgres-data-types.pvh.ca/
======
fyp
In case people read the comments first, this is about postgres data types.

It's pretty comprehensive and I especially liked the section about how
datatypes are implemented internally (pg 25). I wish it went into more details
though.

~~~
giornogiovanna
Yes, it's a very nice overview of Postgres data types.

My only question is: if the "money" type is bad, what should we use instead?
The author proposed a new "currency" type, but that doesn't exist yet.

OT: I initially thought that the article would be about function types, which
are also called exponential types (hence the pun on "power").

~~~
teddyh
My current understanding is that DECIMAL (a.k.a. NUMERIC) is the recommended
type for monetary values in PostgreSQL.

------
masklinn
> money is not a good type, and we can do better.

One of the complexities there is that different systems can have different
constraints for legal or technical reasons e.g. rates during a conversion
could be "current" (whatever the last fetched / set rate was), "at point"
(whatever the rate was at a time associated with the record _somehow_ ) or
"fixed" (contractual), or probably multiple others. And in cases 1 and 2,
different currencies in the system may (again contractually) use different
references and update rates e.g. one client could use the fed with weekly
updates while another uses xe updated daily.

And IIRC (I may be mistaken, or it may have been fixed since) you can't create
a composite type which contains a foreign key to some other table.

------
eyelidlessness
I don't normally comment on the presentation format instead of the content,
but using this slideshow was extremely frustrating and really detracted from
my ability to learn from it. It's really unusual to have scrollable elements
inside slides, __it 's very very frustrating to also have scroll gestures on a
trackpad inside those elements skip a bunch of slides __. There 's content
that just is not accessible without doing a lot of work, and that's
disappointing.

With all of that said, this is super useful and helps me understand postgres
better than I already did.

~~~
lsorber
What is your preferred format for digesting content like this?

~~~
eyelidlessness
I wouldn't really mind a set of slides if it was formatted to prevent
scrollable content, or even if scrolling didn't switch slides.

On the positive side, this slide format didn't destroy my browser history like
a lot of them do, so that was appreciated. A lot of JS slide libs add a
history entry for every slide, so getting back to the original page that
linked it is a giant PITA. I've become accustomed with slides to using the
browser's back button menu to jump back, often several times, and I was
pleasantly surprised not to have to do that this time.

