当前位置: 首页 > wzjs >正文

服装企业网站源码南宁哪个网络公司建网站好

服装企业网站源码,南宁哪个网络公司建网站好,柳州高端网站建设,上海展厅【MySQL\Oracle\PostgreSQL】迁移到openGauss数据出现的问题解决方案 问题1:序列值不自动刷新问题 下面SQL只针对单库操作以及每个序列只绑定一张表的情况 -- 自动生成的序列,设置序列值 with sequences as (select *from (select table_schema,table_…

【MySQL\Oracle\PostgreSQL】迁移到openGauss数据出现的问题解决方案

问题1:序列值不自动刷新问题
下面SQL只针对单库操作以及每个序列只绑定一张表的情况

-- 自动生成的序列,设置序列值
with sequences as (select *from (select table_schema,table_name,column_name,pg_get_serial_sequence(format('%I.%I', table_schema,table_name), column_name) as auto_seq, --<<自动(string_to_array(column_default, E'\''))[2]             as col_seq   --<<手动from information_schema.columnswhere table_schema not in ('pg_catalog', 'information_schema')and column_default ILIKE 'nextval(%'and table_schema = 'usc') t
--                    where auto_seq is not null),maxvals as (select table_schema,table_name,column_name,auto_seq,col_seq,(xpath('/row/max/text()',query_to_xml(format('select max(%I) as max from %I.%I', column_name, table_schema,table_name),true, true, '')))[1]::text::bigint as max_val,(xpath('/row/cur/text()',query_to_xml(format('select last_value as cur from %I.%I',table_schema, col_seq),true, true, '')))[1]::text::bigint as cur_valfrom sequences)
select table_schema,table_name,column_name,auto_seq,col_seq,cur_val,coalesce(max_val, 0) as max_val,setval(col_seq, coalesce(max_val, 1)) --<<设置序列值
from maxvals;

问题2:
字符类型为空字符串迁移后会变成null排查,需要考虑大表问题,防止慢SQL

-- 数据库迁移出现null/空字符串 排除
with t as (select table_schema,table_name,column_name,(xpath('/row/cnt/text()',query_to_xml(format(E'select count(*) as cnt from %I.%I where %I = \'\'', table_schema,table_name, column_name),true, true, '')))[1]::text::bigint as null_cnt
from information_schema.columns
where table_schema not in ('pg_catalog', 'information_schema')and table_schema = 'usc'and is_nullable = 'NO'and udt_name in ('varchar', 'text', 'bpchar'))
select * from t where null_cnt > 0;

问题3:
时间精度问题,导致时间范围查询失败。批量调整时间字段精度

DO
$$DECLAREr RECORD;BEGINFOR r INselect table_name, column_name, udt_namefrom information_schema.columnswhere table_schema not in ('pg_catalog', 'information_schema')and table_schema = 'usc'and udt_name in ('timestamp','timestamptz')LOOPEXECUTE 'ALTER TABLE ' || r.table_name || ' ALTER COLUMN ' || r.column_name || ' TYPE ' || r.udt_name ||'(0)';END LOOP;END
$$;
http://www.dtcms.com/wzjs/600518.html

相关文章:

  • 建设银行网站买手机一键网站制作
  • 有没有专门做兼职的网站网上书店电子商务网站建设
  • 网站类型有开发公司算是业主吗
  • 后台系统免费模板网站市区网站建设情况
  • 南通网站排名团队吕梁营销型网站建设费用
  • 网站运营与管理的目的是建设银行 英文版网站
  • 广州网站运营十年乐云seo深圳全国网站制作哪个好
  • 诚信通旺铺网站建设模板王字库
  • 网站后台的网址忘记了天津建站网
  • 网站建设定制开发推广图文网站模版
  • 普陀手机网站建设住房和城乡建设部政务服务平台
  • 营销网站建设与推广方案广州网站建设开发公司
  • 北京网站建设厂家wordpress多功能主题 cosy
  • 苏州企业如何建网站怎么样查询建设网站
  • 网站如何做路由器redis 缓存 wordpress
  • 常熟企业建设网站公司华云电力建设监理公司网站
  • 哈尔滨网页模板建站dw制作旅游网站教程
  • 泉州网站设计公司国外优秀营销网站设计
  • wordpress 增加站长统计百度竞价包年推广公司
  • 营销网站类型wordpress get_header
  • 建设银行校园招聘网站国家为什么把安阳分了
  • 网站官网认证怎么做的广东省白云区邮政编码
  • 云南网站建设工具创业型企业网站模板
  • 上饶建设银行网站图片识别
  • 网店seo关键词长沙seo优化外包公司
  • 大型网站建设价格专业app制作平台
  • 网站生成app客户端免费永久空间
  • 网站设计的大公司中国优秀的企业网站
  • 建站技术入门网站开发与网页设计大作业
  • 深圳新型材料网站建设公司给别人做的网站违法的吗