diff --git a/src/chunk_constraint.c b/src/chunk_constraint.c index 5e8203d0c..62648b1bb 100644 --- a/src/chunk_constraint.c +++ b/src/chunk_constraint.c @@ -21,7 +21,7 @@ #include #include "compat.h" -#if PG96 || PG10 /* PG11 consolidates pg_foo_fn.h -> pg_foo.h */ +#if PG11_LT /* PG11 consolidates pg_foo_fn.h -> pg_foo.h */ #include #endif diff --git a/src/chunk_index.c b/src/chunk_index.c index aec73a60f..eb3fc5136 100644 --- a/src/chunk_index.c +++ b/src/chunk_index.c @@ -131,7 +131,7 @@ chunk_adjust_colref_attnos(IndexInfo *ii, Relation idxrel, Relation chunkrel) if (attno == InvalidAttrNumber) elog(ERROR, "index attribute %s not found in chunk", NameStr(idxattr->attname)); -#if PG96 || PG10 +#if PG11_LT ii->ii_KeyAttrNumbers[i] = attno; #else ii->ii_IndexAttrNumbers[i] = attno; diff --git a/src/hypertable.c b/src/hypertable.c index 1be38332d..afc4b70b2 100644 --- a/src/hypertable.c +++ b/src/hypertable.c @@ -33,7 +33,7 @@ #include #include #include "compat.h" -#if PG96 || PG10 /* PG11 consolidates pg_foo_fn.h -> pg_foo.h */ +#if PG11_LT /* PG11 consolidates pg_foo_fn.h -> pg_foo.h */ #include #include #endif diff --git a/src/indexing.c b/src/indexing.c index 48c98bc54..799ad124f 100644 --- a/src/indexing.c +++ b/src/indexing.c @@ -28,7 +28,7 @@ #include "hypertable_cache.h" #include "partitioning.h" -#if PG96 || PG10 /* PG11 consolidates pg_foo_fn.h -> pg_foo.h */ +#if PG11_LT /* PG11 consolidates pg_foo_fn.h -> pg_foo.h */ #include #else #include diff --git a/tsl/src/compression/compression.c b/tsl/src/compression/compression.c index 1033494bd..68f860167 100644 --- a/tsl/src/compression/compression.c +++ b/tsl/src/compression/compression.c @@ -219,13 +219,13 @@ compress_chunk(Oid in_table, Oid out_table, const ColumnCompressionInfo **column int n_keys; const ColumnCompressionInfo **keys; - /*We want to prevent other compressors from compressing this table, + /* We want to prevent other compressors from compressing this table, * and we want to prevent INSERTs or UPDATEs which could mess up our compression. * We may as well allow readers to keep reading the uncompressed data while * we are compressing, so we only take an ExclusiveLock instead of AccessExclusive. */ Relation in_rel = table_open(in_table, ExclusiveLock); - /* we are _just_ INSERTing into the out_table so in principle we could take + /* We are _just_ INSERTing into the out_table so in principle we could take * a RowExclusive lock, and let other operations read and write this table * as we work. However, we currently compress each table as a oneshot, so * we're taking the stricter lock to prevent accidents. @@ -265,12 +265,12 @@ compress_chunk(Oid in_table, Oid out_table, const ColumnCompressionInfo **column truncate_relation(in_table); - /* recreate all indexes on out rel, we already have an exvclusive lock on it + /* Recreate all indexes on out rel, we already have an exclusive lock on it, * so the strong locks taken by reindex_relation shouldn't matter. */ reindex_relation(out_table, 0, 0); - RelationClose(out_rel); - RelationClose(in_rel); + table_close(out_rel, NoLock); + table_close(in_rel, NoLock); } static int16 * @@ -1042,12 +1042,12 @@ decompress_chunk(Oid in_table, Oid out_table) FreeBulkInsertState(decompressor.bistate); } - /* recreate all indexes on out rel, we already have an exvclusive lock on it + /* Recreate all indexes on out rel, we already have an exclusive lock on it, * so the strong locks taken by reindex_relation shouldn't matter. */ reindex_relation(out_table, 0, 0); - RelationClose(out_rel); - RelationClose(in_rel); + table_close(out_rel, NoLock); + table_close(in_rel, NoLock); } static PerCompressedColumn * diff --git a/tsl/src/compression/create.c b/tsl/src/compression/create.c index 5dadda6e1..f0f64c5c3 100644 --- a/tsl/src/compression/create.c +++ b/tsl/src/compression/create.c @@ -446,8 +446,8 @@ create_compressed_table_indexes(Oid compresstable_relid, CompressColInfo *compre static void set_statistics_on_compressed_table(Oid compressed_table_id) { - Relation table_rel = relation_open(compressed_table_id, ShareUpdateExclusiveLock); - Relation attrelation = relation_open(AttributeRelationId, RowExclusiveLock); + Relation table_rel = table_open(compressed_table_id, ShareUpdateExclusiveLock); + Relation attrelation = table_open(AttributeRelationId, RowExclusiveLock); TupleDesc table_desc = RelationGetDescr(table_rel); Oid compressed_data_type = ts_custom_type_cache_get(CUSTOM_TYPE_COMPRESSED_DATA)->type_oid; for (int i = 0; i < table_desc->natts; i++) @@ -487,8 +487,8 @@ set_statistics_on_compressed_table(Oid compressed_table_id) heap_freetuple(tuple); } - RelationClose(attrelation); - RelationClose(table_rel); + table_close(attrelation, NoLock); + table_close(table_rel, NoLock); } #if !PG96 && !PG10 diff --git a/tsl/src/compression/create.h b/tsl/src/compression/create.h index b17a2f2dc..e1e74a482 100644 --- a/tsl/src/compression/create.h +++ b/tsl/src/compression/create.h @@ -10,7 +10,6 @@ #include "with_clause_parser.h" #include "hypertable.h" -#include "chunk.h" #define COMPRESSION_COLUMN_METADATA_PREFIX "_ts_meta_" #define COMPRESSION_COLUMN_METADATA_COUNT_NAME COMPRESSION_COLUMN_METADATA_PREFIX "count" diff --git a/tsl/src/reorder.c b/tsl/src/reorder.c index 3f84f8aa8..5b3749f15 100644 --- a/tsl/src/reorder.c +++ b/tsl/src/reorder.c @@ -193,7 +193,7 @@ reorder_chunk(Oid chunk_id, Oid index_id, bool verbose, Oid wait_id, Oid destina ts_cache_release(hcache); aclcheck_error(ACLCHECK_NOT_OWNER, -#if PG96 || PG10 +#if PG11_LT ACL_KIND_CLASS, #else OBJECT_TABLE,