I use Intellij Idea Ultimate 2016.3 version. I try to connect to Postgres DB using the Intellij Idea's default "Database" plugin. However when i try to sync with the DB, I see this in the event log:
ERROR: column reference "oid" is ambiguous Position: 1205.
I tried checking the logs and this is what I found.
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
Then I see there is a query like below getting executed.
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')
)
答案 0 :(得分:2)
在对Intellij Idea论坛进行彻底搜索后,我做了以下事情:
经过上述步骤,才得以解决问题。以下链接帮助了我: