当前位置:网站首页>Jincang database kingbasees plug-in force_ view
Jincang database kingbasees plug-in force_ view
2022-06-25 11:07:00 【Thousands of sails pass by the side of the sunken boat_】
Catalog
3. force_view Is still invalid after recompiling :
4. Generation of effective view creates an effective view :
6. Maintenance of view state maintenance of view state
1. force_view Introduce
force_view Is the invalid state of the view , The view is based on SQL Visual table of statement result set , Its content is defined by query . Views have invalid and valid states . Use an invalid view (force_view) When , If the invalid view is recompiled, it is still invalid , Then an error message will be thrown .
2. force_view The birth of
Create an invalid view :
Use create force view Create an invalid view . establish force view If the dependency check is successful , Create a valid view , Otherwise, it will be created as an invalid view . Here dependency checking is view compilation , The check in the view compilation phase mainly includes : Whether the dependent object exists 、 Whether the creator has a dependency on the object select Authority, etc .create force view vtab as select * from tab; --tab non-existent
WARNING: View created with compilation errors
CREATE VIEW
select reloptions from sys_class where relname = 'vtab';
reloptions
----------------
{status=false}
A valid view becomes an invalid view :
Delete view dependency , Changing the view dependent column will make the dependent view invalid .
create or replace You may also replace a valid view with an invalid view .
create table tab(a int);
CREATE TABLE
create force view vtab as select * from tab;
CREATE VIEW
select reloptions from sys_class where relname = 'vtab';
reloptions
------------
drop table tab;
NOTICE: view vtab depends on table tab
DROP TABLE
select reloptions from sys_class where relname = 'vtab';
reloptions
----------------
{status=false}
3. force_view Use Recompile is still invalid :
Use ( Inquire about , Insert , Update, etc. ) When an invalid view , The view is recompiled . If compilation fails, the view is still invalid , Throw an error .create force view vtab as select * from tab; --tab non-existent
WARNING: View created with compilation errors
CREATE VIEW
select reloptions from sys_class where relname = 'vtab';
reloptions
----------------
{status=false}
select * from vtab;
ERROR: view "vtab" is still invalid after recompiling
Valid after recompilation :
When using an invalid view , The view is recompiled . If compilation is successful , The view is valid , Operate the view according to user instructions .create force view vtab as select * from tab; --tab non-existent
WARNING: View created with compilation errors
CREATE VIEW select reloptions from sys_class where relname = 'vtab';
reloptions
----------------
{status=false}
create table tab(a int);
CREATE TABLE
select * from vtab;
a
---
(0 rows)
select reloptions from sys_class where relname = 'vtab';
reloptions
---------------
{status=true}
4. Generation of effective views Create a valid view :
When creating a view, if the dependency check succeeds, it will be created as a valid view . Create view ( No force ), Dependency check failed , View creation will fail .create table tab(a int);
CREATE TABLE
create force view vtab as select * from tab;
CREATE VIEW
select reloptions from sys_class where relname = 'vtab';
reloptions
------------
create view vtab1 as select * from tab1;
ERROR: relation "tab1" does not exist
LINE 1: create view vtab1 as select * from tab1;
Invalid view becomes valid view :
Use an invalid view , If view recompile succeeds , View becomes a valid view .create force view vtab as select * from tab;
CREATE VIEW
select reloptions from sys_class where relname = 'vtab';
reloptions
----------------
{status=false}
create table tab(a int);
CREATE TABLE
select * from vtab;
a
---
(0 rows)
select reloptions from sys_class where relname = 'vtab';
reloptions
------------
5. Use of valid views
create table tab(a int);
CREATE TABLE
insert into tab values(3);
INSERT 0 1
create view vtab as select * from tab;
CREATE VIEW
select reloptions from sys_class where relname = 'vtab';
reloptions
------------
select * from vtab;
a
---
3
6. Maintenance of view state Maintenance of view state
create table tab(a int);
CREATE TABLE
create view vtab as select * from tab;
CREATE VIEW
create view vvtab as select * from vtab;
CREATE VIEW
select relname, reloptions from sys_class where relname in ('vtab', 'vvtab');
relname | reloptions
---------+------------
vtab |
vvtab |
(2 rows)
drop table tab;
NOTICE: there are(is) 2 objects that depend(s) on it
DETAIL: view vtab depends on table tab
view vvtab depends on view vtab
DROP TABLE
select relname, reloptions from sys_class where relname in ('vtab', 'vvtab');
relname | reloptions
---------+----------------
vtab | {status=false}
vvtab | {status=false}
(2 rows)
边栏推荐
- Apache ShenYu 入门
- Application of global route guard
- Démarrer avec Apache shenyu
- 好好思考
- Shen Lu, China Communications Institute: police open source Protocol - ofl v1.1 Introduction and Compliance Analysis
- Google Earth Engine(GEE)——evaluate實現一鍵批量下載研究區內的所有單張影像(上海市部分區域)
- Free access to the global human settlements layer (ghsl) dataset from Gee
- OODA working method
- XSS攻击
- Advanced single chip microcomputer -- development of PCB (2)
猜你喜欢
Es learning
COSCon'22 讲师征集令
中國信通院沈瀅:字體開源協議——OFL V1.1介紹及合規要點分析
数据库系列:MySQL索引优化总结(综合版)
垃圾回收机制
Explanation and use of kotlin syntax for Android
A five-year technical Er, based on the real experience of these years, gives some suggestions to the fresh students
[image fusion] image fusion based on morphological analysis and sparse representation with matlab code
【文件包含漏洞-03】文件包含漏洞的六种利用方式
Open source invites you to participate in the openssf Open Source Security Online Seminar
随机推荐
Checking whether the double value is an integer - Swift - checking if a double value is an integer - swift
每日3题(3)-检查整数及其两倍数是否存在
Performance memory
金仓KFS数据级联场景部署
ZABBIX distributed system monitoring
16 种企业架构策略
【图像融合】基于形态学分析结合稀疏表征实现图像融合附matlab代码
c盘使用100%清理方法
1-7Vmware中的快照与克隆
Previous string inversion topic
MySQL and Oracle processing CLOB and blob fields
SystemVerilog(十三)-枚举数据类型
查询法,中断法实现USART通信
A random number generator
MySQL synchronous data configuration and shell script implementation
视频会议一体机的技术实践和发展趋势
Handling of NPM I installation problems
Daily Mathematics Series 52: February 20
输出式阅读法:把学到的知识用起来
Use of three-level linkage plug-ins selected by provinces and cities