3 ms·
And there's the Postgres fanboy I knew was coming eventually. :) Could you elaborate on why timestamptz should be used? The name would imply it stores a time z
by Cyberdog 5y ago
And there's the Postgres fanboy I knew was coming eventually. :)
Could you elaborate on why timestamptz should be used? The name would imply it stores a time zone; is that correct, and the normal timestamp type does not as in MySQL?
- jeltz 5y agoYes, the name does imply that but it does not actually store any time zone. The timestamptz type stores a point in time in the UTC time zone with microsecond resolution while the timestamp type stores a point in time in an unknown time zone (which time zone is left up to the application/user) also in microsecond resolution. These types are really useful and closely match the LocalDateTime (=timestamp) and Instant (=timestamptz) classes in Java, but in java they have better names. You almost always want to use timestamptz in columns and only use timestamp when doing certain types of timestamp arthmetics.