period mods
This commit is contained in:
parent
9e05d8261f
commit
10223cf72f
@ -34,7 +34,12 @@ COMMENT ON COLUMN evt.acct.prop IS 'properties';
|
|||||||
CREATE TABLE evt.fspr (
|
CREATE TABLE evt.fspr (
|
||||||
id ltree
|
id ltree
|
||||||
,dur tstzrange
|
,dur tstzrange
|
||||||
);
|
)
|
||||||
|
|
||||||
|
COMMENT ON COLUMN evt.fspr.id IS 'fiscal period';
|
||||||
|
COMMENT ON COLUMN evt.fspr.dur IS 'duration of period as timestamp range';
|
||||||
|
|
||||||
|
CREATE INDEX id_gist ON evt.fspr USING GIST (id);
|
||||||
|
|
||||||
--------------------------relational ledger------------------------------------------
|
--------------------------relational ledger------------------------------------------
|
||||||
|
|
||||||
|
@ -36,6 +36,6 @@ SELECT
|
|||||||
)::ltree t2
|
)::ltree t2
|
||||||
,tstzrange(gs.d,gs.d + '1 month'::interval) r
|
,tstzrange(gs.d,gs.d + '1 month'::interval) r
|
||||||
FROM
|
FROM
|
||||||
generate_series('2018-01-01 00:00'::timestamptz,'2099-12-01 00:00'::timestamptz,'1 month') gs(d)
|
generate_series('2018-01-01 00:00'::timestamptz,'2099-12-01 00:00'::timestamptz,'1 day') gs(d)
|
||||||
INNER JOIN m ON
|
INNER JOIN m ON
|
||||||
m.cm = extract(month from gs.d)
|
m.cm = extract(month from gs.d)
|
@ -2,4 +2,7 @@
|
|||||||
CREATE TABLE evt.fspr (
|
CREATE TABLE evt.fspr (
|
||||||
id ltree
|
id ltree
|
||||||
,dur tstzrange
|
,dur tstzrange
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
CREATE INDEX id_gist ON evt.fspr USING GIST (id);
|
Loading…
Reference in New Issue
Block a user