MCPcopy Create free account
hub / github.com/apache/cloudberry / ExecOpenScanRelation

Function ExecOpenScanRelation

src/backend/executor/execUtils.c:776–798  ·  view source on GitHub ↗

---------------------------------------------------------------- * ExecOpenScanRelation * * Open the heap relation to be scanned by a base-level scan plan node. * This should be called during the node's ExecInit routine. * ---------------------------------------------------------------- */

Source from the content-addressed store, hash-verified

774 * ----------------------------------------------------------------
775 */
776Relation
777ExecOpenScanRelation(EState *estate, Index scanrelid, int eflags)
778{
779 Relation rel;
780
781 /* Open the relation. */
782 rel = ExecGetRangeTableRelation(estate, scanrelid);
783
784 /*
785 * Complain if we're attempting a scan of an unscannable relation, except
786 * when the query won't actually be run. This is a slightly klugy place
787 * to do this, perhaps, but there is no better place.
788 */
789 if ((eflags & (EXEC_FLAG_EXPLAIN_ONLY | EXEC_FLAG_WITH_NO_DATA)) == 0 &&
790 !RelationIsScannable(rel))
791 ereport(ERROR,
792 (errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
793 errmsg("materialized view \"%s\" has not been populated",
794 RelationGetRelationName(rel)),
795 errhint("Use the REFRESH MATERIALIZED VIEW command.")));
796
797 return rel;
798}
799
800/*
801 * ExecInitRangeTable

Callers 15

ExecInitIndexOnlyScanFunction · 0.85
ExecInitDynamicSeqScanFunction · 0.85
ExecInitTidRangeScanFunction · 0.85
ExecInitDynamicIndexScanFunction · 0.85
ExecInitCustomScanFunction · 0.85
ExecInitSeqScanFunction · 0.85
ExecInitForeignScanFunction · 0.85
ExecInitSampleScanFunction · 0.85

Calls 4

errcodeFunction · 0.50
errmsgFunction · 0.50
errhintFunction · 0.50

Tested by

no test coverage detected