Advertisement
Guest User

Untitled

a guest
Apr 24th, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.93 KB | None | 0 0
  1. String url = "jdbc:postgresql://localhost:5432/sampledb?characterEncoding=utf8";
  2. Properties props = new Properties();
  3. PGProperty.USER.set(props, "postgres");
  4. PGProperty.PASSWORD.set(props, "root");
  5. PGProperty.ASSUME_MIN_SERVER_VERSION.set(props, "9.6");
  6. PGProperty.REPLICATION.set(props, "true");
  7. PGProperty.PREFER_QUERY_MODE.set(props, "simple");
  8. DriverManager.registerDriver(new org.postgresql.Driver());
  9. Connection con = DriverManager.getConnection(url, props);
  10. PGConnection replConnection = con.unwrap(PGConnection.class);
  11.  
  12. replConnection.getReplicationAPI()
  13. .createReplicationSlot()
  14. .logical()
  15. .withSlotName("logical_replication_slot")
  16. .withOutputPlugin("test_decoding")
  17. .make();
  18.  
  19. Caused by: org.postgresql.util.PSQLException: ERROR: invalid byte sequence for encoding "UTF8": 0xe9 0x71 0x75
  20. at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2412)[423:org.postgresql.jdbc41:42.0.0.jre7]
  21. at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2125)[423:org.postgresql.jdbc41:42.0.0.jre7]
  22. at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:297)[423:org.postgresql.jdbc41:42.0.0.jre7]
  23. at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:428)[423:org.postgresql.jdbc41:42.0.0.jre7]
  24. at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:354)[423:org.postgresql.jdbc41:42.0.0.jre7]
  25. at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:301)[423:org.postgresql.jdbc41:42.0.0.jre7]
  26. at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:287)[423:org.postgresql.jdbc41:42.0.0.jre7]
  27. at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:264)[423:org.postgresql.jdbc41:42.0.0.jre7]
  28. at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:260)[423:org.postgresql.jdbc41:42.0.0.jre7]
  29. at org.postgresql.replication.fluent.logical.LogicalCreateSlotBuilder.make(LogicalCreateSlotBuilder.java:48)[423:org.postgresql.jdbc41:42.0.0.jre7]
  30. at com.soprahr.hub.replication.postgresql.activator.Activator.start(Activator.java:41)[424:com.soprahr.hub.replication.postgresql:0.0.1.SNAPSHOT]
  31. at org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:697)[org.apache.felix.framework-5.6.1.jar:]
  32. at org.apache.felix.framework.Felix.activateBundle(Felix.java:2226)[org.apache.felix.framework-5.6.1.jar:]
  33. ... 16 more
  34.  
  35. client_encoding = windows-1251 # actually, defaults to database
  36. # encoding
  37.  
  38. # These settings are initialized by initdb, but they can be changed.
  39. lc_messages = 'French_France.1252' # locale for system error message
  40. # strings
  41. lc_monetary = 'French_France.1252' # locale for monetary formatting
  42. lc_numeric = 'French_France.1252' # locale for number formatting
  43. lc_time = 'French_France.1252' # locale for time formatting
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement