相关疑难解决方法(0)

如果在PostgreSQL上不存在列,如何添加列?

问题很简单.如何将列添加x到表中y,但仅当x列不存在时?我在这里找到了解决方法,如何检查列是否存在.

SELECT column_name 
FROM information_schema.columns 
WHERE table_name='x' and column_name='y';
Run Code Online (Sandbox Code Playgroud)

postgresql postgresql-9.1

128
推荐指数
5
解决办法
10万
查看次数

标签 统计

postgresql ×1

postgresql-9.1 ×1