Skip to main content

Module view_rewrite

Module view_rewrite 

Source
Expand description

PostgreSQL 18 automatically updatable view analysis and DML rewriting.

Re-exports§

pub use rule_inputs::rule_input_requirements;
pub use rule_inputs::validate_grouped_rule_inputs;
pub use crate::catalog::view::ViewMutationCapabilities;

Modules§

context
Catalog and authorization inputs for automatic view analysis and DML rewriting.
rule_inputs
Surviving input dependencies across automatic views and rewrite rules.

Structs§

AutomaticViewLayer
ViewColumn
ViewUpdatability

Enums§

MergeViewTargetPath
NotUpdatableReason
Why a view cannot be rewritten onto its base relation. RewriteQuery tests conditional INSTEAD rules first, and view_query_is_auto_updatable tests the rest in the order listed.
ViewCheckOption
ViewQueryShape
What view_query_is_auto_updatable finds in a view’s own query, short of its test for an updatable column, which depends on the command.

Functions§

automatic_view_layer
has_instead_of_trigger
merge_view_target_path
Choose how a MERGE reaches view plan.target, as RewriteQuery and rewriteTargetView do: through the view’s INSTEAD OF triggers when every action has one, and otherwise by rewriting the view onto its base relation, which its query must allow, with an updatable column when an action inserts or updates. When it does not, the first action in WHEN order without a trigger reports why; an automatically updatable view cannot mix the two paths.
relation_columns
rewrite_delete_to_base
rewrite_insert_to_base
rewrite_merge_to_base
rewrite_update_to_base
validate_public_merge_contract
validate_public_merge_targets
validate_view_definition_check_option
view_query_shape
The shape of the query of view name, or None when name names no regular view.
view_updatability