|
PostgreSQL Source Code git master
|
#include "postgres.h"#include "access/genam.h"#include "access/heapam.h"#include "access/htup_details.h"#include "access/multixact.h"#include "access/tableam.h"#include "access/xact.h"#include "catalog/indexing.h"#include "catalog/namespace.h"#include "catalog/pg_am.h"#include "catalog/pg_opclass.h"#include "commands/cluster.h"#include "commands/matview.h"#include "commands/tablecmds.h"#include "commands/tablespace.h"#include "executor/executor.h"#include "executor/spi.h"#include "miscadmin.h"#include "pgstat.h"#include "rewrite/rewriteHandler.h"#include "storage/lmgr.h"#include "tcop/tcopprot.h"#include "utils/builtins.h"#include "utils/lsyscache.h"#include "utils/rel.h"#include "utils/snapmgr.h"#include "utils/syscache.h"
Go to the source code of this file.
Data Structures | |
| struct | DR_transientrel |
Variables | |
| static int | matview_maintenance_depth = 0 |
Definition at line 964 of file matview.c.
References Assert, and matview_maintenance_depth.
Referenced by refresh_by_match_merge().
| DestReceiver * CreateTransientRelDestReceiver | ( | Oid | transientoid | ) |
Definition at line 464 of file matview.c.
References DestTransientRel, _DestReceiver::mydest, palloc0_object, DR_transientrel::pub, _DestReceiver::rDestroy, _DestReceiver::receiveSlot, _DestReceiver::rShutdown, _DestReceiver::rStartup, DR_transientrel::transientoid, transientrel_destroy(), transientrel_receive(), transientrel_shutdown(), and transientrel_startup().
Referenced by CreateDestReceiver(), and RefreshMatViewByOid().
| ObjectAddress ExecRefreshMatView | ( | RefreshMatViewStmt * | stmt, |
| const char * | queryString, | ||
| QueryCompletion * | qc | ||
| ) |
Definition at line 120 of file matview.c.
References AccessExclusiveLock, ExclusiveLock, fb(), RangeVarCallbackMaintainsTable(), RangeVarGetRelidExtended(), RefreshMatViewByOid(), and stmt.
Referenced by ProcessUtilitySlow().
Definition at line 903 of file matview.c.
References attnum, fb(), i, NIL, RelationData::rd_index, and RelationGetIndexPredicate().
Referenced by refresh_by_match_merge(), and RefreshMatViewByOid().
Definition at line 952 of file matview.c.
References matview_maintenance_depth.
Referenced by CheckValidResultRel().
Definition at line 958 of file matview.c.
References matview_maintenance_depth.
Referenced by refresh_by_match_merge().
Definition at line 893 of file matview.c.
References fb(), finish_heap_swap(), ReadNextMultiXactId(), and RecentXmin.
Referenced by RefreshMatViewByOid().
|
static |
Definition at line 591 of file matview.c.
References appendStringInfo(), appendStringInfoString(), attnum, CloseMatViewIncrementalMaintenance(), COMPARE_EQ, DatumGetPointer(), elog, ereport, errcode(), errdetail(), errmsg(), ERROR, fb(), generate_operator_clause(), get_namespace_name(), get_opfamily_member_for_cmptype(), GETSTRUCT(), HeapTupleIsValid, i, index_close(), index_open(), initStringInfo(), is_usable_unique_index(), lfirst_oid, list_free(), NameStr, NoLock, ObjectIdGetDatum(), OidIsValid, OpenMatViewIncrementalMaintenance(), palloc0_array, psprintf(), quote_qualified_identifier(), RelationData::rd_index, RelationData::rd_indextuple, RelationGetIndexList(), RelationGetNamespace, RelationGetNumberOfAttributes, RelationGetRelationName, ReleaseSysCache(), resetStringInfo(), RowExclusiveLock, SearchSysCache1(), SECURITY_LOCAL_USERID_CHANGE, SECURITY_RESTRICTED_OPERATION, SetUserIdAndSecContext(), SPI_connect(), SPI_exec(), SPI_execute(), SPI_finish(), SPI_getvalue(), SPI_OK_DELETE, SPI_OK_FINISH, SPI_OK_INSERT, SPI_OK_SELECT, SPI_OK_UTILITY, SPI_processed, SPI_tuptable, SysCacheGetAttrNotNull(), table_close(), table_open(), SPITupleTable::tupdesc, TupleDescAttr(), and SPITupleTable::vals.
Referenced by RefreshMatViewByOid().
|
static |
Definition at line 404 of file matview.c.
References AcquireRewriteLocks(), CHECK_FOR_INTERRUPTS, copyObject, CreateQueryDesc(), CURSOR_OPT_PARALLEL_OK, elog, ERROR, EState::es_processed, QueryDesc::estate, ExecutorEnd(), ExecutorFinish(), ExecutorRun(), ExecutorStart(), fb(), ForwardScanDirection, FreeQueryDesc(), GetActiveSnapshot(), InvalidSnapshot, linitial, list_length(), pg_plan_query(), plan, PopActiveSnapshot(), PushCopiedSnapshot(), QueryRewrite(), and UpdateActiveSnapshotCommandId().
Referenced by RefreshMatViewByOid().
| ObjectAddress RefreshMatViewByOid | ( | Oid | matviewOid, |
| bool | is_create, | ||
| bool | skipData, | ||
| bool | concurrent, | ||
| const char * | queryString, | ||
| QueryCompletion * | qc | ||
| ) |
Definition at line 164 of file matview.c.
References AccessExclusiveLock, AccessShareLock, Assert, AtEOXact_GUC(), CheckRelationOidLockedByMe(), CheckTableNotInUse(), CMD_SELECT, CreateTransientRelDestReceiver(), elog, ereport, errcode(), errhint(), errmsg(), ERROR, ExclusiveLock, fb(), get_namespace_name(), GetDefaultTablespace(), GetUserIdAndSecContext(), index_close(), index_open(), is_usable_unique_index(), lfirst_oid, linitial_node, list_free(), list_length(), make_new_heap(), matview_maintenance_depth, NewGUCNestLevel(), NoLock, ObjectAddressSet, PG_CATCH, PG_END_TRY, PG_RE_THROW, PG_TRY, pgstat_count_heap_insert(), pgstat_count_truncate(), quote_qualified_identifier(), refresh_by_heap_swap(), refresh_by_match_merge(), refresh_matview_datafill(), RelationGetIndexList(), RelationGetNamespace, RelationGetRelationName, RelationIsPopulated, RestrictSearchPath(), SECURITY_RESTRICTED_OPERATION, SetMatViewPopulatedState(), SetQueryCompletion(), SetUserIdAndSecContext(), table_close(), and table_open().
Referenced by ExecCreateTableAs(), and ExecRefreshMatView().
Definition at line 78 of file matview.c.
References Assert, CatalogTupleUpdate(), CommandCounterIncrement(), elog, ERROR, fb(), GETSTRUCT(), heap_freetuple(), HeapTupleIsValid, newstate(), ObjectIdGetDatum(), RelationData::rd_rel, RelationGetRelid, RowExclusiveLock, SearchSysCacheCopy1, HeapTupleData::t_self, table_close(), and table_open().
Referenced by intorel_startup(), and RefreshMatViewByOid().
|
static |
Definition at line 553 of file matview.c.
References pfree().
Referenced by CreateTransientRelDestReceiver().
|
static |
Definition at line 508 of file matview.c.
References fb(), and table_tuple_insert().
Referenced by CreateTransientRelDestReceiver().
|
static |
Definition at line 536 of file matview.c.
References fb(), FreeBulkInsertState(), NoLock, table_close(), and table_finish_bulk_insert().
Referenced by CreateTransientRelDestReceiver().
|
static |
Definition at line 482 of file matview.c.
References Assert, fb(), GetBulkInsertState(), GetCurrentCommandId(), InvalidBlockNumber, NoLock, RelationGetTargetBlock, TABLE_INSERT_FROZEN, TABLE_INSERT_SKIP_FSM, and table_open().
Referenced by CreateTransientRelDestReceiver().
|
static |
Definition at line 56 of file matview.c.
Referenced by CloseMatViewIncrementalMaintenance(), MatViewIncrementalMaintenanceIsEnabled(), OpenMatViewIncrementalMaintenance(), and RefreshMatViewByOid().