PostgreSQL 错误:列 am.amcanorder 不存在
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/38427585/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
PostgreSQL Error: column am.amcanorder doesn't exist
提问by player87
I am working on CentOS release 6.8 (Final) based server without sudo access. I compiled PostgreSQL v9.6 beta 2.
我正在开发基于 CentOS 6.8(最终版)的服务器,无需 sudo 访问。我编译了 PostgreSQL v9.6 beta 2。
When I am loading data using ant, I get am.amcanorder column doesn't existerror which I don't know how to fix.
当我使用 ant 加载数据时,我收到am.amcanorder column does not exist错误,我不知道如何修复。
I am following a tutorial to set up Intermine data warehousing system and I am on this step.
我正在按照教程设置 Intermine 数据仓库系统,我正在这一步。
ant -Dsource=uniprot-malaria -v
This will take a couple of minutes to complete, the command runs the following steps:
这将需要几分钟才能完成,该命令运行以下步骤:
- Checks that a source with name uniprot-malaria exists in project.xml
- Reads the UniProt XML files at the location specified by src.data.dir
- Calls the parser included in the uniprot source with the list of files, this reads the original XML and creates Items which are metadata representations of the objects that will be loaded into the malariamine database.
- These items are stored in an intermediate items database. Reads from the items database, converts items to objects and loads them into the malariamine database.
- 检查 project.xml 中是否存在名为 uniprot-malaria 的源
- 在 src.data.dir 指定的位置读取 UniProt XML 文件
- 使用文件列表调用包含在 uniprot 源中的解析器,这将读取原始 XML 并创建项目,这些项目是将加载到疟疾数据库中的对象的元数据表示。
- 这些项目存储在中间项目数据库中。从项目数据库中读取,将项目转换为对象并将它们加载到疟疾数据库中。
The bold part is what (in my opinion) causing the error. The relevant error verbose is:
粗体部分是(在我看来)导致错误的原因。相关的错误详细是:
org.postgresql.util.PSQLException: ERROR: column am.amcanorder does not exist
Position: 407
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2161)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1890)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:559)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:403)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:283)
at org.postgresql.jdbc2.AbstractJdbc2DatabaseMetaData.getIndexInfo(AbstractJdbc2DatabaseMetaData.java:4234)
at org.intermine.task.CreateIndexesTask.execute(CreateIndexesTask.java:212)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
采纳答案by player87
Well the problem was fixed by compiling v9.5.3, the latest stable version at this time. Previously, I was using v9.6beta2 ... which has a reported errorwhen working with JDBC & v9.6beta2.
那么问题是通过编译v9.5.3解决的,这是目前最新的稳定版本。以前,我使用的是 v9.6beta2 ...在使用 JDBC 和 v9.6beta2 时报告了错误。
回答by ancab
Player87 is right, it works just by replacing the newer version 9.6* with 9.5.* of the PostgresSQLserver.
But, there is another solution. For a Java project, I have also tried leaving PostgresSQLserveron 9.6.* and updated the PostgresSQL driver, from version 9.4-1203 to the newest one 9.4-1211.
In a maven pom.xml file:
Player87 是对的,它只需将较新版本 9.6* 替换为 9.5.* 的PostgresSQL服务器即可。
但是,还有另一种解决方案。对于 Java 项目,我还尝试将PostgresSQL服务器保留在 9.6.* 上并更新了 PostgresSQL 驱动程序,从版本 9.4-1203 到最新的 9.4-1211。在 maven pom.xml 文件中:
<postgresql.version>9.4.1211</postgresql.version>
That worked for me too.
这对我也有用。
回答by GreenTurtle
For me (connecting to PostgreSQL from a Java/Maven application and facing the same error) it was a driver issue.
对我来说(从 Java/Maven 应用程序连接到 PostgreSQL 并面临相同的错误)这是一个驱动程序问题。
Updating PostgreSQL driver from 9.4-1201-jdbc41 to 42.1.4 resolved it. My Maven dependency now looks like this:
将 PostgreSQL 驱动程序从 9.4-1201-jdbc41 更新到 42.1.4 解决了它。我的 Maven 依赖现在看起来像这样:
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.1.4</version>
</dependency>
回答by Naga Srinu Kapusetti
I faced the same issue with SpringBoot and have solved this by upgrading my driver
我在 SpringBoot 上遇到了同样的问题,并通过升级我的驱动程序解决了这个问题
For Spring Boot 1.4.0 I just added the following Dependency
对于 Spring Boot 1.4.0,我刚刚添加了以下依赖项
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
</dependency>