diff --git "a/content/zh/post/gaoyunlong/PostgreSQL\344\270\216openGauss\344\271\213\345\205\263\351\224\256\345\255\227.md" "b/content/zh/post/gaoyunlong/PostgreSQL\344\270\216openGauss\344\271\213\345\205\263\351\224\256\345\255\227.md" new file mode 100644 index 0000000000000000000000000000000000000000..cb52a017939f8af6d88dcdecc5e4e82039dda305 --- /dev/null +++ "b/content/zh/post/gaoyunlong/PostgreSQL\344\270\216openGauss\344\271\213\345\205\263\351\224\256\345\255\227.md" @@ -0,0 +1,127 @@ ++++ + +title = "PostgreSQL与openGauss之关键字" + +date = "2020-12-17" + +tags = ["openGauss与postgresql对比"] + +archives = "2020-12" + +author = "高云龙" + +summary = "PostgreSQL与openGauss之关键字" + +img = "/zh/post/gaoyunlong/title/title.PNG" + +times = "16:40" + ++++ + +# PostgreSQL与openGauss之关键字 + +日常数据库运维的过程中可能对数据库关键字关注点并不是很高,但在程序开发的过程中,数据库对象建模要尽可能的避开数据库关键字的使用,否则在后续开发过程中需要用到各种转译的方法来将关键字转换为普通字符,会非常的麻烦。最近在openGauss上执行date函数后报语法错误,经查询openGauss是支持date函数的,但却用不了,真对这个问题,分别在PostgreSQL12.2数据库和openGauss(1.0.1)数据库进行问题复现并问题分析。 + +在openGauss执行结果如下: + + + +在PostgreSQL执行date函数结果如下: + + + +经调查发现是date关键字的问题。 + +在openGauss的关键字列表中,虽然不是保留关键字,但是不允许是函数或者类型。 + + + +在PostgreSQL的关键字列表中,是一个普通字符。 + + + +由此问题进行深入思考,对比PostgreSQL与openGauss数据库中哪些关键字做了差异化说明,避免在日常使用中再次遇到类似问题。 + + +
+ | + | ++ | +
---|---|---|
+ | ++ | ++ | +
+ | ++ | ++ | +
+ | ++ | ++ | +
+ | ++ | ++ | +
+ | ++ | ++ | +
+ | ++ | ++ | +
+ | ++ | ++ | +
+ | ++ | ++ | +
+ | ++ | ++ | +
+ | ++ | ++ | +
+ | + | ++ | ++ | ++ | +
---|---|---|---|---|
+ | ++ | ++ | ++ | ++ | +
+ | ++ | ++ | ++ | ++ | +
+ | ++ | ++ | ++ | ++ | +
+ | ++ | + | ++ | ++ | +
+ | ++ | ++ | ++ | ++ | +
+ | ++ | ++ | ++ | ++ | +
+ | ++ | ++ | ++ | ++ | +
+ | ++ | ++ | ++ | ++ | +
+ | ++ | ++ | ++ | ++ | +
+ | ++ | ++ | ++ | ++ | +
+ | ++ | ++ | ++ | ++ | +
+ | ++ | ++ | ++ | ++ | +
+ | ++ | ++ | ++ | ++ | +
+ | ++ | ++ | ++ | ++ | +
+ | ++ | ++ | ++ | ++ | +
+ | ++ | ++ | ++ | ++ | +
+ | ++ | ++ | ++ | ++ | +
+ | ++ | ++ | ++ | ++ | +
+ | ++ | ++ | ++ | ++ | +
+ | + | ++ | ++ | ++ | +
---|---|---|---|---|
+ | ++ | ++ | ++ | ++ | +
+ | ++ | ++ | ++ | ++ | +
+ | ++ | ++ | ++ | ++ | +
+ | ++ | ++ | ++ | ++ | +
+ | ++ | ++ | ++ | ++ | +
+ | ++ | ++ | ++ | ++ | +
+ | ++ | ++ | ++ | ++ | +
+ | + | ++ | ++ | ++ | +
---|---|---|---|---|
+ | ++ | ++ | ++ | ++ | +
+ | ++ | ++ | ++ | ++ | +
+ | ++ | ++ | ++ | ++ | +
+ | ++ | ++ | ++ | ++ | +
+ | ++ | ++ | ++ | ++ | +
+ | ++ | ++ | ++ | ++ | +
+ | ++ | + | ++ | ++ | +
+ | ++ | + | ++ | ++ | +
+ | ++ | + | ++ | ++ | +
+ | + | ++ | ++ | ++ | +
---|---|---|---|---|
+ | ++ | ++ | ++ | ++ | +
+ | ++ | ++ | ++ | ++ | +
+ | + | ++ | ++ | ++ | +
---|---|---|---|---|
+ | ++ | ++ | ++ | ++ | +