PostgreSQL:错误:“NOT”处或附近的语法错误

juz*_*lin 0 postgresql centos libpqxx docker

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

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...
                                                             ^
Run Code Online (Sandbox Code Playgroud)

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

小智 6

“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