当前位置:网站首页>Several pits of Ruoyi switching from mysql to postgresql
Several pits of Ruoyi switching from mysql to postgresql
2022-08-05 15:02:00 【yelangking1】
Because of the needs of engineering applications, ruoyi's database support needs to be switched from mysql to postgresql.There are also some open source demos or integrated frameworks on the Internet that indicate that the database has been switched.This article will briefly introduce several problems that may be encountered when switching databases, and how to solve them.
Although they are both relational databases, mysql and postgresql are not very compatible in terms of sql compatibility, and many syntaxes supported by mysql are not known in postgresql.
Less gossip, let's enter the text below.
1. Replace the mysql-dependent jar package with postgresql in the pom.xml file.
org.postgresql postgresql
Second, mybatis-plus or paging plug-in database category support.
The characters in the red boxes in the two places aboveto be replaced.
Three, the database connection pool should be adjusted accordingly

Fourth, automatic task dependencies, if you have enabled the quartz component, please remember to open the following comments
//pg enables special configuration, otherwise an error will be reported update by wuzuhu on 20181224//prop.put("org.quartz.jobStore.driverDelegateClass", "org.quartz.impl.jdbcjobstore.PostgreSQLDelegate");
5. In all Mapper.xml configuration files, find the function with sysdate(), which needs to be replaced with the now() function.
6. All query functions with date need to be replaced with the following code:

7. The mysql find_in_set() function can use the ANY() scheme.For example:
#{deptId} || '' = ANY(STRING_TO_ARRAY(ancestors, ',')) 
Summary: The above steps can basically complete the switch of Ruoyi's database from mysql to postgresql, I hope it can help you.If you have a better migration plan, please leave a message to exchange.
边栏推荐
猜你喜欢

语音聊天app开发——开发人员如何进行代码分析

2022最新综述 | 面向大规模场景的小目标检测:综述和 benchmark

To be a famous corporate scientist or to be a tenured professor, this is a question

基于rt-thread studio的STM32裸机开发第二节补充说明:OLED

Observation cloud product update|DCA web terminal is online; new global viewer auto refresh configuration; new global blacklist function; new custom function menu, etc.

Study Notes 251—XMind Shortcuts Summary

Advanced roadmap for technical salary increase of full-stack software test engineers (with information)

如果有10个词,我想从中取3个词,然后把所有的10选3的可能统计记录下来,该怎么做?...

【kali-Metasploit】Armitage常见问题:sudo权限、连接不到数据库、service not found

Ruoyi从mysql切换到postgresql的几个坑
随机推荐
深度卷积神经网络是什么,卷积神经网络结构设计
umi3.5新特性之提速方案mfsu
正交-不相关-独立
十五个AI图像放大工具
Fundamentals of Probability Theory - 10 - Common Probability Distributions
To be a famous corporate scientist or to be a tenured professor, this is a question
请指教我想今天开户,可以么?手机开户安全么?
阿里P8整理的《百亿级并发系统设计》实战教程,实在是太香了
Graduation thesis description layout sample
2264. 字符串中最大的 3 位相同数字
web安全入门-安全应急响应演练与报告
如何找回u盘里丢失的文件,u盘里的文件丢了怎么找回
兵荒马乱,毕业季的故事
双因子与多因子身份验证有什么区别?
当名企科学家,还是当终身教授,这是一个问题
Score-CAM|用kernel加权解释CNN的预测结果
PAT甲级:1043 Is It a Binary Search Tree
Highlights of efficient meeting minutes
go语言的ini文件配置读取
图神经网络 图像处理,为什么用图神经网络