尝试修改列类型但出现错误
我正在运行此命令
alter table client_details alter column name type character varying(120);
,但随后出现错误,
ERROR: syntax error at or near "view" at character 7
LINE 1: alter view v1 alter column name type character varying(120);
我注意到存在导致问题的视图,如何更改视图中的类型或解决此问题?
I'm running this command
alter table client_details alter column name type character varying(120);
but then get the error
ERROR: syntax error at or near "view" at character 7
LINE 1: alter view v1 alter column name type character varying(120);
I've noticed that a view exists thats causing the problem, how can I alter the type in the vieww, or solve this issue?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不幸的是 PostgreSQL 对此非常严格。
您需要删除引用该表的视图,然后更改列类型,然后重新创建视图。
Unfortunately PostgreSQL is very strict about this.
You need to drop the view that references that table, then alter the column type and then recreate the view.