Postgres timestamp that will be the same across regions

Hello everyone, So I have a statement like the following:
CREATE TABLE your_table_name (
created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT CURRENT_TIMESTAMP AT TIME ZONE 'UTC'
);
CREATE TABLE your_table_name (
created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT CURRENT_TIMESTAMP AT TIME ZONE 'UTC'
);
Becaue I want my backend code to store the same timestamp no matter the region. But drizzle schema file is red on:
createdAt: timestamp("created_at", { withTimezone: true, mode: 'string' }).default((CURRENT_TIMESTAMP AT TIME ZONE 'UTC'::text)),
createdAt: timestamp("created_at", { withTimezone: true, mode: 'string' }).default((CURRENT_TIMESTAMP AT TIME ZONE 'UTC'::text)),
Because:
Cannot find name 'CURRENT_TIMESTAMP'
Cannot find name 'CURRENT_TIMESTAMP'
Will this cause me issues in the future ? All I'm trying to do is to have my backend set "created_at" the same across different regions. I'm pretty new so any suggestions would be great, thanks!
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server