11
mam tabelę elementów z kolumny:Dodawanie <integer> sekund do <timestamp> PostgreSQL
start_time
kolumnowej (timestamp without time zone
)expiration_time_seconds
kolumnę (integer
)
Przykładowo niektóre wartości to:
SELECT start_time, expiration_time_seconds
FROM whatever
ORDER BY start_time;
start_time | expiration_time_seconds
----------------------------+-------------------------
2014-08-05 08:23:32.428452 | 172800
2014-08-10 09:49:51.082456 | 3600
2014-08-13 13:03:56.980073 | 3600
2014-08-21 06:31:38.596451 | 3600
...
Jak dodać czas wygaśnięcia podany w sekundach do czasu początkowego?
Próbowałem sformatować interwału ciąg czasowy dla komendy interval
, ale nie powiodło się:
blah=> SELECT interval concat(to_char(3600, '9999'), ' seconds');
ERROR: syntax error at or near "("
LINE 1: SELECT interval concat(to_char(3600, '9999'), ' seconds');
niesamowite. dzięki... – des1roer