Add support for PostgreSQL 18 (#145)
- Fixed compiler errors and warnings. - Added expected/pg_ivm_0.out to accommodate message changes introduced in PostgreSQL 18.
This commit is contained in:
parent
8232f7fc9b
commit
96fdf6f789
5 changed files with 1771 additions and 1 deletions
17
createas.c
17
createas.c
|
|
@ -101,7 +101,11 @@ create_immv_internal(List *attrList, IntoClause *into)
|
|||
CreateStmt *create = makeNode(CreateStmt);
|
||||
char relkind;
|
||||
Datum toast_options;
|
||||
#if defined(PG_VERSION_NUM) && (PG_VERSION_NUM >= 180000)
|
||||
const char *const validnsps[] = HEAP_RELOPT_NAMESPACES;
|
||||
#else
|
||||
static char *validnsps[] = HEAP_RELOPT_NAMESPACES;
|
||||
#endif
|
||||
ObjectAddress intoRelationAddr;
|
||||
|
||||
/* This code supports both CREATE TABLE AS and CREATE MATERIALIZED VIEW */
|
||||
|
|
@ -148,7 +152,12 @@ create_immv_internal(List *attrList, IntoClause *into)
|
|||
NewRelationCreateToastTable(intoRelationAddr.objectId, toast_options);
|
||||
|
||||
/* Create the "view" part of an IMMV. */
|
||||
#if defined(PG_VERSION_NUM) && (PG_VERSION_NUM >= 180000)
|
||||
StoreImmvQuery(intoRelationAddr.objectId, into->viewQuery);
|
||||
#else
|
||||
StoreImmvQuery(intoRelationAddr.objectId, (Query *) into->viewQuery);
|
||||
#endif
|
||||
|
||||
CommandCounterIncrement();
|
||||
|
||||
return intoRelationAddr;
|
||||
|
|
@ -1514,10 +1523,18 @@ CreateIndexOnIMMV(Query *query, Relation matviewRel)
|
|||
|
||||
indexRel = index_open(indexoid, AccessShareLock);
|
||||
|
||||
#if defined(PG_VERSION_NUM) && (PG_VERSION_NUM >= 180000)
|
||||
if (CheckIndexCompatible(indexRel->rd_id,
|
||||
index->accessMethod,
|
||||
index->indexParams,
|
||||
index->excludeOpNames,
|
||||
false))
|
||||
#else
|
||||
if (CheckIndexCompatible(indexRel->rd_id,
|
||||
index->accessMethod,
|
||||
index->indexParams,
|
||||
index->excludeOpNames))
|
||||
#endif
|
||||
hasCompatibleIndex = true;
|
||||
|
||||
index_close(indexRel, AccessShareLock);
|
||||
|
|
|
|||
|
|
@ -1395,6 +1395,8 @@ CREATE FUNCTION mytype_out(mytype)
|
|||
RETURNS cstring AS 'int4out'
|
||||
LANGUAGE INTERNAL STRICT IMMUTABLE;
|
||||
NOTICE: argument type mytype is only a shell
|
||||
LINE 1: CREATE FUNCTION mytype_out(mytype)
|
||||
^
|
||||
CREATE TYPE mytype (
|
||||
LIKE = int4,
|
||||
INPUT = mytype_in,
|
||||
|
|
|
|||
1743
expected/pg_ivm_0.out
Normal file
1743
expected/pg_ivm_0.out
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -617,7 +617,11 @@ refresh_immv_datafill(DestReceiver *dest, Query *query,
|
|||
ExecutorStart(queryDesc, 0);
|
||||
|
||||
/* run the plan */
|
||||
#if PG_VERSION_NUM < 180000
|
||||
ExecutorRun(queryDesc, ForwardScanDirection, 0, true);
|
||||
#else
|
||||
ExecutorRun(queryDesc, ForwardScanDirection, 0);
|
||||
#endif
|
||||
|
||||
processed = queryDesc->estate->es_processed;
|
||||
|
||||
|
|
|
|||
4
pg_ivm.c
4
pg_ivm.c
|
|
@ -224,7 +224,11 @@ create_immv(PG_FUNCTION_ARGS)
|
|||
ctas->into->options = NIL;
|
||||
ctas->into->onCommit = ONCOMMIT_NOOP;
|
||||
ctas->into->tableSpaceName = NULL;
|
||||
#if defined(PG_VERSION_NUM) && (PG_VERSION_NUM >= 180000)
|
||||
ctas->into->viewQuery = (Query *) parsetree->stmt;
|
||||
#else
|
||||
ctas->into->viewQuery = parsetree->stmt;
|
||||
#endif
|
||||
ctas->into->skipData = false;
|
||||
|
||||
query = transformStmt(pstate, (Node *) ctas);
|
||||
|
|
|
|||
Loading…
Reference in a new issue