【问题标题】:PostgreSQL: ERROR: syntax error at or near "NOT"PostgreSQL:错误:“NOT”处或附近的语法错误
【发布时间】:2020-03-15 04:53:29
【问题描述】:

这可能有什么问题(CentOS 上的 PostgreSQL 9.2.24 从 Docker 容器中使用):

terminate called after throwing an instance of 'pqxx::syntax_error'
  what():  ERROR:  syntax error at or near "NOT"
LINE 1: ...olver_fit_length BIGINT NOT NULL);CREATE INDEX IF NOT EXISTS...
                                                             ^

同样的代码在我的主机 Ubuntu 18.04 和 PostgreSQL 10 上运行良好,所以我不确定要修复什么以及在哪里修复。

【问题讨论】:

    标签: postgresql docker centos libpqxx


    【解决方案1】:

    “IF NOT EXISTS”已在 PostgreSQL 9.5 中引入- 9.2 版不支持它 -> https://www.postgresql.org/docs/9.2/sql-createindex.htmlhttps://www.postgresql.org/docs/9.5/sql-createindex.html

    【讨论】:

      猜你喜欢
      • 2013-09-10
      • 1970-01-01
      • 2021-01-17
      • 1970-01-01
      • 1970-01-01
      • 2016-06-04
      • 2016-11-22
      • 2016-10-30
      • 1970-01-01
      相关资源
      最近更新 更多