如何删除列当且仅当它存在于9+版本的postgres中
我正在尝试从表中删除一列。
什么是检查列是否存在的最佳实践。
我通过文档https://www.postgresql.org/docs/9.2/static/sql-altertable.html但没有找到任何示例如何做到这一点。
甚至在stackoverflow中发现此如何检查SQL Server表中是否存在一列,但似乎不太相关
ALTER TABLE tableName DROP COLUMN IF EXISTS columnName;
链接地址: http://www.djcxy.com/p/94409.html上一篇: How to drop column if and only if it exists in postgres in 9+ version