gpt4 book ai didi

postgresql - Intellij Idea Ultimate Postgres/EDB 数据库插件 "oid"不明确

转载 作者:行者123 更新时间:2023-11-29 14:38:11 26 4
gpt4 key购买 nike

我使用的是 Intellij Idea Ultimate 2016.3 版本。我尝试使用 Intellij Idea 的默认“数据库”插件连接到 Postgres DB。但是,当我尝试与数据库同步时,我在事件日志中看到了这一点:

ERROR: column reference "oid" is ambiguous Position: 1205.

我尝试检查日志,这是我发现的。

Caused by: org.jetbrains.dekaf.exceptions.StrippedSQLException: org.postgresql.util.PSQLException: ERROR: column reference "oid" is ambiguous   Position: 1205
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2270)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1998)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:570)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:420)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:413)
at org.jetbrains.dekaf.jdbc.JdbcIntermediateSeance.execute(JdbcIntermediateSeance.java:100)
at com.intellij.database.remote.jdba.impl.RemoteSeanceImpl.execute(RemoteSeanceImpl.java:28)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:324)
at sun.rmi.transport.Transport$1.run(Transport.java:200)
at sun.rmi.transport.Transport$1.run(Transport.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:683)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682)
... 3 more

然后我看到执行了如下查询。

The SQL statement:

select max(last_tx) as state_number from (select max(xmin::varchar::bigint) as last_tx
from pg_catalog.pg_type
where typnamespace = oid(?)
union all
select max(xmin::varchar::bigint) as last_tx
from pg_catalog.pg_class where relnamespace = oid(?)
union all
select max(xmin::varchar::bigint) as last_tx
from pg_catalog.pg_proc where pronamespace = oid(?)
union all
select max(xmin::varchar::bigint) as last_tx
from pg_catalog.pg_operator where oprnamespace = oid(?)
union all
select max(A.xmin::varchar::bigint) as last_tx
from pg_catalog.pg_attribute A
join pg_catalog.pg_class K on K.oid = A.attrelid
where K.relnamespace = oid(?)
union all
select max(xmin::varchar::bigint) as last_tx
from pg_catalog.pg_constraint
where connamespace = oid(?)
union all
select max(IX.xmin::varchar::bigint) as last_tx
from pg_catalog.pg_index IX, pg_catalog.pg_class IC
where IC.oid = IX.indrelid and IC.relnamespace = oid(?)
union all
select max(RU.xmin::varchar::bigint) as last_tx
from pg_catalog.pg_rewrite RU, pg_catalog.pg_class RC
where RC.oid = RU.ev_class and RC.relnamespace = oid(?)
union all
select max(TG.xmin::varchar::bigint) as last_tx
from pg_catalog.pg_trigger TG, pg_catalog.pg_class TC
where TC.oid = TG.tgrelid and TC.relnamespace = oid(?)
union all
select max(DE.xmin::varchar::bigint) as last_tx
from pg_catalog.pg_description DE, pg_catalog.pg_class DC
where DC.oid = DE.objoid and DC.relnamespace = oid(?) and DC.relkind in ('r', 'm', 'v')
)

最佳答案

在对 Intellij Idea 论坛进行全面搜索后,我执行了以下操作:

  1. 创建连接时,在“选项”选项卡下提供一个对象过滤器。例如:table:ABC_.*(假设所有表都以 ABC_ 前缀开头)
  2. 选中“Introspect using JDBC metadata”
  3. 从“加载源”选择框中选择“除了系统架构”

经过以上步骤,问题得以解决。以下链接对我有帮助:

  1. https://intellij-support.jetbrains.com/hc/en-us/community/posts/207089995--Basic-attribute-type-should-not-be-Object-
  2. https://youtrack.jetbrains.com/issue/IDEA-150816
  3. https://youtrack.jetbrains.com/issue/DBE-2771

希望这对某人有帮助

关于postgresql - Intellij Idea Ultimate Postgres/EDB 数据库插件 "oid"不明确,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41061170/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com