Sorry for being unclear - the solution I have in production appears to work with CREATE DOMAIN UTC_TIMESTAMP AS TIMESTAMP WITH TIME ZONE CHECK (EXTRACT(TIMEZONE FROM VALUE) = 0); This raises an exception when an app doesn’t use UTC.
This is what I wanted to achieve and the approach so far seems to work. It is just that most people think the approach is weird. And this is the reason for the OP - a knowledgable person on a different list saw this approach, thought it was weird and suggested that I should educate myself. Which led me to asking on this list. And the consensus appears to be that the approach is weird and that there are other ways to achieve timezone explicitness, one of which is to gain a deep understanding of how Postgres handles and stores timestamps. |