Follow best practive don't use timestamp(0)

https://wiki.postgresql.org/wiki/Don%27t_Do_This#Don.27t_use_timestamp.280.29_or_timestamptz.280.29
This commit is contained in:
xbgmsharp
2023-11-19 21:49:19 +01:00
parent 4c6d6290f0
commit 21f96483f5

View File

@@ -46,7 +46,7 @@ CREATE OR REPLACE VIEW api.vessels_view WITH (security_invoker=true,security_bar
SELECT SELECT
v.name as name, v.name as name,
v.mmsi as mmsi, v.mmsi as mmsi,
v.created_at::timestamp(0) as created_at, v.created_at as created_at,
m.last_contact as last_contact, m.last_contact as last_contact,
((NOW() AT TIME ZONE 'UTC' - m.last_contact::TIMESTAMPTZ) > INTERVAL '70 MINUTES') as offline, ((NOW() AT TIME ZONE 'UTC' - m.last_contact::TIMESTAMPTZ) > INTERVAL '70 MINUTES') as offline,
(NOW() AT TIME ZONE 'UTC' - m.last_contact::TIMESTAMPTZ) as duration (NOW() AT TIME ZONE 'UTC' - m.last_contact::TIMESTAMPTZ) as duration