PDM的preview选项卡中sql可以直接在命令行执行

pdm版本:16.6 SP04

preview选项卡中默认sql

create table us.us_user (
   user_id	int8	not null,
   age		int8	not null default 0,
   constraint pk_us_user primary key (user_id)
)
without oids;

comment on table us.us_user is '用户表';

comment on column us_user.user_id is '用户标识';

上面的sql在navicate的查询窗口中是可以正常执行的,但是在command窗口(命令行窗口)中执行到最后一行时会报错,错误信息如下:ERROR:  relation "us_user" does not exist。

修改为:comment on column od.us_user.user_id is '用户标识'; 就可以执行了。

所以要将preview选项卡中生成的sql中加上schema,修改方式:

在 pdm 视图中,Database --> Edit Current DBMS --> Postgre SQL 9.x --> Script --> Objects --> Column --> ColumnComment。

value中增加红色字体:comment on column [%QUALIFIER%]%TABLE%.%COLUMN% is
%.q:COMMENT%

 

这个红色字体可以从Postgre SQL 9.x --> Script --> Objects --> Table--> TableComment中找到。

因为preview生成的sql中table的comment是有schema的。

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值