by manigandham · 7y ago · 0 comments
It is not actually a data type, it's just timezone but the database will convert what you send to UTC. Any time a database decides to store something different than what you provide will be an endless source of bugs. It also doesn't store the timezone so you need a separate column for that anyway if necessary.
Use normal `timestamp`. Always use UTC in your code for any "instant in time" and a separate column for user-facing appointment scheduling.
It's an extra risk that offers nothing. Just use UTC in your code, there's no reason not to and is much better advice. If you don't use UTC, at least you can still recover and convert easily if you are using the standard `timestamp` type since it's exactly what you saved.
The `timestamptz` type is a mistake and one of the few things where PG gets overly ambitious in helping, only to cause more pain that it's worth.