Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PG14 changes #3398

Merged
merged 3 commits into from Jul 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/postgres_dev.yaml
Expand Up @@ -10,7 +10,7 @@ jobs:
PG_INSTALL_DIR: postgresql
MAKE_JOBS: 2
# postgres version to build against this can either be commit hash, branch or tag
PG_COMMIT: 3d351d916b
PG_COMMIT: 1375422
CLANG: clang-9
LLVM_CONFIG: llvm-config-9
CC: gcc
Expand Down
7 changes: 7 additions & 0 deletions src/copy.c
Expand Up @@ -241,8 +241,10 @@ copyfrom(CopyChunkState *ccstate, List *range_table, Hypertable *ht, void (*call

ExecOpenIndices(resultRelInfo, false);

#if PG14_LT
estate->es_result_relations = resultRelInfo;
estate->es_num_result_relations = 1;
#endif
estate->es_result_relation_info = resultRelInfo;
estate->es_range_table = range_table;

Expand Down Expand Up @@ -446,7 +448,12 @@ copyfrom(CopyChunkState *ccstate, List *range_table, Hypertable *ht, void (*call

ExecCloseIndices(resultRelInfo);
/* Close any trigger target relations */
#if PG14_LT
ExecCleanUpTriggerState(estate);
#else
ExecCloseResultRelations(estate);
ExecCloseRangeTableRelations(estate);
#endif

/*
* If we skipped writing WAL, then we need to sync the heap (but not
Expand Down
3 changes: 2 additions & 1 deletion src/planner.c
Expand Up @@ -330,7 +330,8 @@ timescaledb_planner(Query *parse, int cursor_opts, ParamListInfo bound_params)
{
Plan *subplan = (Plan *) lfirst(lc);

ts_hypertable_insert_fixup_tlist(subplan);
if (subplan)
ts_hypertable_insert_fixup_tlist(subplan);
}
}
}
Expand Down
21 changes: 19 additions & 2 deletions src/process_utility.c
Expand Up @@ -1489,8 +1489,14 @@ reindex_chunk(Hypertable *ht, Oid chunk_relid, void *arg)
stmt->relation->relname = NameStr(chunk->fd.table_name);
stmt->relation->schemaname = NameStr(chunk->fd.schema_name);
ReindexTable(stmt->relation,
stmt->options,
stmt->options
#if PG14_LT
,
stmt->concurrent /* should test for deadlocks */
#elif PG14_GE
,
false /* isTopLevel */
#endif
);
break;
case REINDEX_OBJECT_INDEX:
Expand Down Expand Up @@ -1534,7 +1540,11 @@ process_reindex(ProcessUtilityArgs *args)
{
PreventCommandDuringRecovery("REINDEX");
ts_hypertable_permissions_check_by_id(ht->fd.id);
#if PG14_LT
if (stmt->concurrent)
#else
if (stmt->options & REINDEXOPT_CONCURRENTLY)
#endif
ereport(ERROR,
(errmsg("concurrent index creation on hypertables is not supported")));

Expand Down Expand Up @@ -2635,7 +2645,14 @@ process_cluster_start(ProcessUtilityArgs *args)
* Since we keep OIDs between transactions, there is a potential
* issue if an OID gets reassigned between two subtransactions
*/
cluster_rel(cim->chunkoid, cim->indexoid, stmt->options);
cluster_rel(cim->chunkoid,
cim->indexoid,
stmt->options
#if PG14_GE
,
args->context == PROCESS_UTILITY_TOPLEVEL
#endif
);
PopActiveSnapshot();
CommitTransactionCommand();
}
Expand Down
3 changes: 3 additions & 0 deletions tsl/src/reorder.c
Expand Up @@ -627,6 +627,9 @@ copy_heap_data(Oid OIDNewHeap, Oid OIDOldHeap, Oid OIDOldIndex, bool verbose,
0,
0,
0,
#if PG14_GE
true,
#endif
&OldestXmin,
&FreezeXid,
NULL,
Expand Down