pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Dearman <tom.dearman@voidbridge.com>
To: pgsql-general@postgresql.org
Subject: Java client fails to connect to database with replication slots registered if targetServerType=master
Date: Wed, 7 Mar 2018 13:35:28 +0000
Message-ID: <AD029DCF-2882-440F-9524-36E5110DA802@voidbridge.com> (raw)

Hi,

We are trying to use logical decoding on our db (9.4.17), I have written a decoder based on the examples one, it runs ok on my local db, but we found that in another environment we we unable to get a db connection.  It turns out to be related to having targetServerType=master in our jdbc connection string, if we set this to ‘any' everything works fine.  The error we get when it is set to 'master’ is below.  Any ideas what is going on or whether this is a bug.

org.postgresql.util.PSQLException: ERROR: syntax error
	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2422)
	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2167)
	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:306)
	at org.postgresql.core.SetupQueryRunner.run(SetupQueryRunner.java:53)
	at org.postgresql.core.v3.ConnectionFactoryImpl.isMaster(ConnectionFactoryImpl.java:701)
	at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:218)
	at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49)
	at org.postgresql.jdbc.PgConnection.<init>(PgConnection.java:195)
	at org.postgresql.Driver.makeConnection(Driver.java:452)
	at org.postgresql.Driver.connect(Driver.java:254)
	at java.sql.DriverManager.getConnection(DriverManager.java:664)
	at java.sql.DriverManager.getConnection(DriverManager.java:247)
	at org.postgresql.ds.common.BaseDataSource.getConnection(BaseDataSource.java:94)
	at org.postgresql.ds.common.BaseDataSource.getConnection(BaseDataSource.java:79)
	at net.sf.log4jdbc.sql.jdbcapi.DataSourceSpy.getConnection(DataSourceSpy.java:149)
	at sun.reflect.GeneratedMethodAccessor503.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at org.sixty6.as66.platform.service.support.StaticServiceProxyMethodInterceptor.invoke(StaticServiceProxyMethodInterceptor.java:52)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
	at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:133)
	at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:121)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
	at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:133)
	at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:121)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
	at com.sun.proxy.$Proxy93.getConnection(Unknown Source)
	at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:111)
	at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:77)
	at org.sixty6.as66.utils.postgresql.logicaldecoding.LogicalDecodingConsumer$WorkerThread.doRun(LogicalDecodingConsumer.java:86)
	at org.sixty6.as66.utils.concurrent.PollingWorkerThread.run(PollingWorkerThread.java:140)

Message-ID: <AD029DCF-2882-440F-9524-36E5110DA802@voidbridge.com>
Permalink:  ../AD029DCF-2882-440F-9524-36E5110DA802@voidbridge.com/
Also on:    postgresql.org/message-id/AD029DCF-2882-440F-9524-36E5110DA802@voidbridge.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: tom.dearman@voidbridge.com
  Subject: Re: Java client fails to connect to database with replication slots registered if targetServerType=master
  In-Reply-To: <AD029DCF-2882-440F-9524-36E5110DA802@voidbridge.com>
  References: <AD029DCF-2882-440F-9524-36E5110DA802@voidbridge.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox