pgjdbc/pgjdbc GitHub issues and pull requests (mirror)  
help / color / mirror / Atom feed
From: vlsi (@vlsi) <[email protected]>
To: pgjdbc/pgjdbc <[email protected]>
Subject: Re: [pgjdbc/pgjdbc] PR #2648: Fix getObject(int, class)
Date: Fri, 06 Jun 2025 08:49:27 +0000
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>

(on pgjdbc/src/main/java/org/postgresql/jdbc/PgCallableStatement.java:665)

This conversion does not look right.
I believe we should mimic `PgResultSet#getObject(int, Class)` so we use proper conversion methods for various types.
For instance, if a call returns `Timestamp`, and the user asks `getObject(1, String.class)` we should probably return a string-based representation rather than failing with `ClassCastException`.

The same goes for `getObject(1, LocalDateTime.class)`.
If we ever support more classes, we'd better add the relevant tests for it rather than release a feature and get a lot of complains on `ClassCastException` later

view thread (10+ messages)  latest in thread

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 using the --to and --cc options:
  reply via email

  To: github://pgjdbc/pgjdbc
  Cc: [email protected], [email protected]
  Subject: Re: [pgjdbc/pgjdbc] PR #2648: Fix getObject(int, class)
  In-Reply-To: <<[email protected]>>

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

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