当前位置:网站首页>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)
边栏推荐
- Application of global route guard
- 金仓数据库 KingbaseES 插件identity_pwdexp
- GaussDB others内存比较高的场景
- scrapy+scrapyd+gerapy 爬虫调度框架
- Démarrer avec Apache shenyu
- Sign up to open the third session of the "flying oar hacker marathon". It's been a long time
- 【文件包含漏洞-03】文件包含漏洞的六种利用方式
- Detailed explanation of Android interview notes handler
- 有关计网的五种类型题
- Growth: how to think deeply and learn
猜你喜欢
![[observation] objectscale: redefining the next generation of object storage, reconstruction and innovation of Dell Technology](/img/82/8cac87231e51698ab17f1274b3a0bd.jpg)
[observation] objectscale: redefining the next generation of object storage, reconstruction and innovation of Dell Technology

Android之Kotlin语法详解与使用

中国信通院沈滢:字体开源协议——OFL V1.1介绍及合规要点分析

数据库系列:MySQL索引优化总结(综合版)

【图像融合】基于形态学分析结合稀疏表征实现图像融合附matlab代码

zabbix分布式系统监控

今天16:00 | 中科院计算所研究员孙晓明老师带大家走进量子的世界

Binder explanation of Android interview notes

Explanation and use of kotlin syntax for Android

Kotlin arrays and collections (1) {create arrays, use arrays, use for in loops to traverse arrays, use array indexes, and multi-dimensional arrays}
随机推荐
Android: generic mapping analysis of gson and JSON in kotlin
[maintain cluster case set] gaussdb query user space usage
每日3题(3)-检查整数及其两倍数是否存在
Google Earth Engine (Gee) - evaluate réalise le téléchargement en un clic de toutes les images individuelles dans la zone d'étude (certaines parties de Shanghai)
CSRF attack
Network remote access using raspberry pie
撸一个随机数生成器
VW VH adaptation of mobile terminal
【上云精品】节能提效!加速纺织业“智造”转型
At 16:00 today, Mr. sunxiaoming, a researcher of the Institute of computing, Chinese Academy of Sciences, took you into the quantum world
龙书虎书鲸书啃不动?试试豆瓣评分9.5的猴书
Kotlin implements a simple login page
Continuous delivery jenkinsfile syntax
XSS attack
每日3題(3)-檢查整數及其兩倍數是否存在
Server rendering
FPGA基于VGA显示字符及图片
金仓数据库 KingbaseES 插件DBMS_OUTPUT
金仓数据库 KingbaseES 插件DBMS_RANDOM
一个五年北漂的技术er,根据这些年的真实经历,给应届生的一些建议