timescaledb/src/with_clause_parser.h
Matvey Arye cc862a3c5a Implement WITH options for continuous aggs
1) Change with clause name to 'timescaledb.continuous'

Used to be timescaledb.continuous_agg as a text field, now is a bool.

2) Add more WITH options for continuous aggs

- Refresh lag control the amount by which the materialization will lag
  behind a the maximum current time value.

- Refresh interval controls how often the background materializer is run.

3) Handle ALTER VIEW on continuous aggs

Handle setting WITH options using continuous views.
Block all other ALTER VIEW commands on user and partial views.
2019-04-26 13:08:00 -04:00

35 lines
902 B
C

/*
* This file and its contents are licensed under the Apache License 2.0.
* Please see the included NOTICE for copyright information and
* LICENSE-APACHE for a copy of the license.
*/
#ifndef TIMESCALEDB_WITH_CLAUSE_PARSER_H
#define TIMESCALEDB_WITH_CLAUSE_PARSER_H
#include <postgres.h>
#include <c.h>
#include <nodes/parsenodes.h>
#include <utils.h>
#include "compat.h"
typedef struct WithClauseDefinition
{
const char *arg_name;
Oid type_id;
Datum default_val;
} WithClauseDefinition;
typedef struct WithClauseResult
{
bool is_default;
Datum parsed;
} WithClauseResult;
extern TSDLLEXPORT void ts_with_clause_filter(const List *def_elems, List **within_namespace,
List **not_within_namespace);
extern TSDLLEXPORT WithClauseResult *
ts_with_clauses_parse(const List *def_elems, const WithClauseDefinition *args, Size nargs);
#endif /* TIMESCALEDB_WITH_CLAUSE_PARSER_H */