Questions tagged [pg-jdbc]

PGJDBC is a Java driver for the Postgresql relational database management system.

35 questions
20
votes
4 answers

Postgres UUID JDBC not working

The latest Java JDBC drivers for postgres claim to support UUIDs natively; working against Postgres 9.2 (mac). Indeed, when a PreparedStatement is used, I can step through the driver code, and even walk through the specialised 'setUuid' function in…
user340535
  • 663
  • 2
  • 6
  • 15
9
votes
1 answer

LISTEN/NOTIFY pgconnection goes down java?

I am using PostgreSQL DB and applying it's LISTEN/NOTIFY functionality. So my listener is at my AS (Application Server) and I have triggers configured on my DB such that when CRUD operations are performed on a table a NOTIFY request is sent on AS.…
6
votes
5 answers

DBeaver PostgreSQL Database - SCRAM authentication is not supported by this driver

I am trying to add a PostgreSQL database to DBeaver and am getting the following error when I try to connect to the database. I'm using DBeaver Version 7.2.3.202010191702. And after receiving this message I installed the latest version of the JDK…
monkeymynd
  • 69
  • 1
  • 1
  • 5
6
votes
2 answers

What's the difference between loginTimeout, connectTimeout and socketTimeout in pgjdbc

In pgjdbc we have: loginTimeout connectTimeout socketTimeout cancelSignalTimeout But it isn't clear to me what's the difference (when are they applied) between loginTimeout, connectTimeout and socketTimeout.
Michel Feinstein
  • 13,416
  • 16
  • 91
  • 173
6
votes
0 answers

postgresql Logical Replication Stream fails with "Database connection failed when reading from copy"

Hi I am reading from logical replication stream continuously in infinite while loop. and I have another program that is continuously populating a table in the same database. I notice that after some time (around 5-10 minutes). I always get the…
5
votes
0 answers

Movement of restart_lsn position movement of logical replication slots is very slow

We have two logical replication slots in our postgresql database (version-11) instance and we are using pgJDBC to stream data from these two slots. We are ensuring that when we regularly send feedback and update the confirmed_flush_lsn (every 10…
5
votes
2 answers

Both vacuum_count and analyze_count are zero after VACUUM ANALYZE

I've written a unit test which modifies a table (INSERT's and DELETE's), then manually VACUUM's and ANALYZE's it, and then I query pg_stat_user_tables to make sure that VACUUM and ANALYZE did have some effect. I use the following SQL: select …
Bass
  • 4,977
  • 2
  • 36
  • 82
3
votes
0 answers

Failed to pass a custom type from java as parameter of a postgres procedure

https://docs.spring.io/spring-data/jdbc/old-docs/current/reference/html/orcl.datatypes.html DB : Postgres Trying to pass a custom type from java as parameter of a procedure following above url. Custom Type: CREATE TYPE schm.TESTTYPE AS ( …
Anwar
  • 31
  • 2
3
votes
0 answers

SSL connection using pgjdbc-ng as Java driver for Postgres

I'm facing a great problem in connecting to a Postgres database using https://github.com/impossibl/pgjdbc-ng/. I need this lib because I need to get asynchronous notification from the database. I'm trying to connect to a remote database using SSL an…
mgaido
  • 2,987
  • 3
  • 17
  • 39
2
votes
1 answer

Why is the query timeout ignored in PostgreSQL?

I run a query against PostgreSQL DB using jOOQ. Since I know this query will take a long time, I try to set the query timeout. I tried several ways, but each time the result is that the query timeout is ignored and the query fails after a minute…
Dikla
  • 3,461
  • 5
  • 30
  • 43
2
votes
0 answers

Increased latency when using @Transactional(readOnly=true)

I am working with a backend service (Spring Boot 2.2.13.RELEASE + Hikari + JOOQ) that uses an AWS Aurora PostgreSQL DB cluster configured with a Writer (primary) node and a Reader (Read Replica) node. The reader node has just been sitting there…
frm
  • 53
  • 6
2
votes
1 answer

What are the bennefits of prepareThreshold = 5 in pgjdbc?

The prepareThreshold in pgjdbc have the following definition: Determine the number of PreparedStatement executions required before switching over to use server side prepared statements. The default is five, meaning start using server side prepared…
Michel Feinstein
  • 13,416
  • 16
  • 91
  • 173
2
votes
0 answers

Cached plan must not change result type

Our service team is getting the error Cached plan must not change result type sometimes when I modify the length of a column or add a new column in the table. I tried solutions mentioned on Stack Overflow like Postgres: "ERROR: cached plan must not…
YogeshR
  • 1,606
  • 2
  • 22
  • 43
2
votes
2 answers

Pg-jdbc Appends RETURNING * on Prepared Batch wtih Existing RETURNING Clause

I am executing a prepared batch insert into a Postgres table using pg-jdbc/JDBI in order to obtain a list of generated id values using an explicit RETURNING clause: PreparedBatch b = getHandle().prepareBatch("INSERT INTO death_star(id,exhaust_port)…
THX1138
  • 1,518
  • 14
  • 28
2
votes
1 answer

Is it possible to write a jOOQ Converter to apply to an array?

I have a postgres database with some columns that are of type varchar[]. jOOQ and pgjdbc-ng aren't playing along nicely; jOOQ's DefaultBindContext has something along the lines of: protected final BindContext bindValue0(Object value, Field field)…
Andrew Rueckert
  • 4,858
  • 1
  • 33
  • 44
1
2 3