【标题描述】:
【测试类型:SQL功能】【测试版本:5.1.0】default值导出后无法导入
【操作系统和硬件信息】(查询命令: cat /etc/system-release, uname -a):
【测试环境】(单机/1主x备x级联备):
单机
【被测功能】:
SQL功能
【测试类型】:
default值
【数据库版本】(查询命令: gaussdb -V):
gaussdb (openGauss 5.1.0 build 419bf8c4) compiled at 2023-06-14 11:52:59 commit 0 last mr debug
【预置条件】:
B库+插件
【操作步骤】(请填写详细的操作步骤):
create table t1(a timestamp default pg_systimestamp()::timestamp(0));
导出后再导入
【预期输出】:
导入成功,表结构正常
【实际输出】:
导入失败
可通过show create table查看表结构信息,结果如下:
self_b=# show create table t1;
Table | Create Table
-------+--------------------------------------------------------------------------------------------
t1 | SET search_path = public; +
| CREATE TABLE t1 ( +
| a timestamp(0) with time zone DEFAULT (pg_systimestamp())::timestamp(0) with time zone+
| ) +
| WITH (orientation=row, compression=no);
(1 row)
当前由于支持default() 函数,导致default后面不能跟括号,导出的信息里面有括号,导致导入失败:
self_b=# CREATE TABLE t1 ( a timestamp(0) with time zone DEFAULT (pg_systimestamp())::timestamp(0) with time zone);
ERROR: syntax error at or near "("
LINE 1: ...TABLE t1 ( a timestamp(0) with time zone DEFAULT (pg_systim...
去掉括号的话则能成功:
self_b=# CREATE TABLE t1 ( a timestamp(0) with time zone DEFAULT pg_systimestamp()::timestamp(0) with time zone);
CREATE TABLE
【原因分析】:
【日志信息】(请附上日志文件、截图、coredump信息):
【测试代码】:
Hey @pengjiong, Welcome to openGauss Community.
All of the projects in openGauss Community are maintained by @opengauss_bot.
That means the developers can comment below every pull request or issue to trigger Bot Commands.
Please follow instructions at Here to find the details.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
Hi @pengjiong,
if you want to get quick review about your issue, please contact the owner in first: @黄凯耀 ,
and then any of the maintainers: @黄凯耀 , @CodeRejector
and then any of the committers: @吴岳川 , @熊小军 , @xiuqiangwang , @zhaojun , @husan1024 , @siven_dev , @chenxiaobin , @jeremytim , @pengjiong , @wumingyuan , @zhaosiqi
if you have any question, please contact the SIG: Plugin.
gs_dump工具导出导入验证通过
登录 后才可以发表评论