修改列类型与众不同
alter table adqm_safe_data_encrypt_job_instance alter COLUMN state TYPE INT4
设置列非空
alter table data_watermark_rule alter COLUMN encrypt_type set not null
alter COLUMN state TYPE INT4
pg_catalog.pg_namespace来查看当前数据库中全部的Schema
select oid,* from pg_catalog.pg_namespace;
创建schema
create schema gs_dqms
显示当前使用的schema
SHOW search_path;
切换当前schema
SET search_path TO gs_dqms;
查看Schema---- dgp_sd下所有表的大小:
select relname, pg_size_pretty(pg_total_relation_size(relid)) from pg_stat_user_tables where schemaname='gs_dqms' order by pg_relation_size (relid) desc;
查看所有数据库的大小
select pg_database.datname, pg_size_pretty(pg_database_size(pg_database.datname)) AS size from pg_database;
查询数据库中的所有表:(指定schema)
select * from information_schema.tables
select * from information_schema.columns where table_schema='gs_dqms';
select * from information_schema.tables where table_schema='gs_dqms';
查询数据库信息
select oid,* from pg_database where datname='adq_dgp' and datdba=16919;
查询库空间信息
select oid,* from pg_namespace where nspname='gs_dqms2023' and nspowner=16919;
relkind |
char |
r = 普通表, i = 索引, S = 序列, t = TOAST表, v = 视图, m = 物化视图, c = 组合类型, f = 外部表, p = 分区表, I = 分区索引 |
查询表 :
select * from pg_catalog.pg_class where relnamespace=94165 and relowner=16919 and relkind = 'r' and
select* from pg_catalog.pg_attribute;
select* from pg_index;
select* from pg_constraint;
查询指定schema的存储过程
select oid::regprocedure as proname,prosrc from pg_proc where pronamespace=(SELECT oid FROM pg_namespace where nspname ='gs_dqms') and prokind='p'
查询指定schema的函数文章来源:https://www.toymoban.com/news/detail-471268.html
select oid::regprocedure as proname,prosrc from pg_proc where pronamespace=(SELECT oid FROM pg_namespace where nspname ='gs_dqms') and prokind='p' or prokind='f'文章来源地址https://www.toymoban.com/news/detail-471268.html
到了这里,关于gaussDB的schema创建查询,及其查询下面的表列,修改列类型的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!