-
Notifications
You must be signed in to change notification settings - Fork 898
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change show_chunks/drop_chunks using creation time
- Updated show_chunks, drop_chunks APIs to get the affected chunks using chunk creation time metadata based on the "date/time/interval" like boundary specified for the INTEGER columns. - We honor "integer_now" function if it's specified so as to keep backwards compatibility with the existing behavior Co-authored-by: Dipesh Pandit <[email protected]>
- Loading branch information
Showing
28 changed files
with
851 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Implements: #6177 Change show_chunks/drop_chunks using chunk creation time | ||
Thanks: @pdipesh02 for contributing to the implementation of this feature |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -127,7 +127,9 @@ CREATE OR REPLACE FUNCTION @[email protected]_chunks( | |
relation REGCLASS, | ||
older_than "any" = NULL, | ||
newer_than "any" = NULL, | ||
verbose BOOLEAN = FALSE | ||
verbose BOOLEAN = FALSE, | ||
created_before "any" = NULL, | ||
created_after "any" = NULL | ||
) RETURNS SETOF TEXT AS '@MODULE_PATHNAME@', 'ts_chunk_drop_chunks' | ||
LANGUAGE C VOLATILE PARALLEL UNSAFE; | ||
|
||
|
@@ -136,7 +138,9 @@ LANGUAGE C VOLATILE PARALLEL UNSAFE; | |
CREATE OR REPLACE FUNCTION @[email protected]_chunks( | ||
relation REGCLASS, | ||
older_than "any" = NULL, | ||
newer_than "any" = NULL | ||
newer_than "any" = NULL, | ||
created_before "any" = NULL, | ||
created_after "any" = NULL | ||
) RETURNS SETOF REGCLASS AS '@MODULE_PATHNAME@', 'ts_chunk_show_chunks' | ||
LANGUAGE C STABLE PARALLEL SAFE; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -179,3 +179,24 @@ DROP TABLE _timescaledb_internal.tmp_chunk_seq_value; | |
GRANT SELECT ON _timescaledb_catalog.chunk_id_seq TO PUBLIC; | ||
GRANT SELECT ON _timescaledb_catalog.chunk TO PUBLIC; | ||
-- end recreate _timescaledb_catalog.chunk table -- | ||
|
||
DROP FUNCTION @[email protected]_chunks(REGCLASS, "any", "any", BOOL); | ||
CREATE FUNCTION @[email protected]_chunks( | ||
relation REGCLASS, | ||
older_than "any" = NULL, | ||
newer_than "any" = NULL, | ||
verbose BOOLEAN = FALSE, | ||
created_before "any" = NULL, | ||
created_after "any" = NULL | ||
) RETURNS SETOF TEXT AS '@MODULE_PATHNAME@', 'ts_chunk_drop_chunks' | ||
LANGUAGE C VOLATILE PARALLEL UNSAFE; | ||
|
||
DROP FUNCTION @[email protected]_chunks(REGCLASS, "any", "any"); | ||
CREATE FUNCTION @[email protected]_chunks( | ||
relation REGCLASS, | ||
older_than "any" = NULL, | ||
newer_than "any" = NULL, | ||
created_before "any" = NULL, | ||
created_after "any" = NULL | ||
) RETURNS SETOF REGCLASS AS '@MODULE_PATHNAME@', 'ts_chunk_show_chunks' | ||
LANGUAGE C STABLE PARALLEL SAFE; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -124,3 +124,21 @@ GRANT SELECT ON _timescaledb_catalog.chunk_id_seq TO PUBLIC; | |
GRANT SELECT ON _timescaledb_catalog.chunk TO PUBLIC; | ||
|
||
-- end recreate _timescaledb_catalog.chunk table -- | ||
|
||
|
||
DROP FUNCTION @[email protected]_chunks(REGCLASS, "any", "any", BOOL, "any", "any"); | ||
CREATE FUNCTION @[email protected]_chunks( | ||
relation REGCLASS, | ||
older_than "any" = NULL, | ||
newer_than "any" = NULL, | ||
verbose BOOLEAN = FALSE | ||
) RETURNS SETOF TEXT AS '@MODULE_PATHNAME@', 'ts_chunk_drop_chunks' | ||
LANGUAGE C VOLATILE PARALLEL UNSAFE; | ||
|
||
DROP FUNCTION @[email protected]_chunks(REGCLASS, "any", "any", "any", "any"); | ||
CREATE FUNCTION @[email protected]_chunks( | ||
relation REGCLASS, | ||
older_than "any" = NULL, | ||
newer_than "any" = NULL | ||
) RETURNS SETOF REGCLASS AS '@MODULE_PATHNAME@', 'ts_chunk_show_chunks' | ||
LANGUAGE C STABLE PARALLEL SAFE; |
Oops, something went wrong.