Files
grafana/pkg/tsdb/grafana-postgresql-datasource/testdata/table/timestamp_convert_bigint.sql
Gábor Farkas ecc667c9a5 postgres: add snapshot tests (#79794)
* postgres: add snapshot tests

* fixed wrong comment

Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>

---------

Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
2024-01-09 16:54:21 +02:00

14 lines
618 B
SQL

-- SELECT * FROM tbl
-- the time-field and time-end field gets converted to time.Time
CREATE TEMPORARY TABLE tbl (
reallyt timestamp with time zone, -- reference real timestamp
"time" bigint,
n bigint, -- normal number, it should not get converted to a timestamp
timeend bigint
);
INSERT INTO tbl (reallyt, "time", n, timeend) VALUES
('2023-12-24T14:21:27 UTC', 1703161287, 1703161287, 1703161312),
('2023-12-24T14:21:27.724 UTC', 1703161287724, 1703161287724, 1703161312522),
('2023-12-24T14:21:27.724919 UTC', 1703161287724919000, 1703161287724919000, 1703161312522186000),
(NULL, NULL, NULL, NULL);