在 postgresql 8.2 上执行以下命令时:
CREATE INDEX product_index_8 ON product (product_id DESC, naam DESC, verbruik_per_eenheid DESC, inhoud DESC, barcode DESC);
我们得到错误:
ERROR: syntax error at or near "DESC"
LINE 1: ...EATE INDEX product_index_8 ON product (product_id DESC, naam...
********** Error **********
ERROR: syntax error at or near "DESC"
SQL state: 42601
Character: 53
谁知道这是怎么回事?我们在 oracle 服务器上有相同的索引,它可以正常工作。
最佳答案
据推测,您使用的不是 PostgreSQL,而是 Greenplum 数据库或 Amazon Redshift。
如果你真的在使用 8.2:PostgreSQL 8.2 does not support DESC
ending ordered indexes .
Newer versions do - 它是在 8.3 中添加的,根据 the release notes和文档。
升级,8.2 is obsolete .
关于postgresql - 使用 desc 在 postgresql 上创建索引时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24011561/