Re: BUG #17427: ERROR: cannot cast type bytea to bigint - Mailing list pgsql-bugs

From David G. Johnston
Subject Re: BUG #17427: ERROR: cannot cast type bytea to bigint
Date
Msg-id CAKFQuwaK439fhf+OqF5q9kp7h6F2rZD78NLNqjtpxchwF1=M=g@mail.gmail.com
Whole thread Raw
In response to BUG #17427: ERROR: cannot cast type bytea to bigint  (PG Bug reporting form <noreply@postgresql.org>)
List pgsql-bugs
On Sun, Mar 6, 2022 at 4:14 PM PG Bug reporting form <noreply@postgresql.org> wrote:
The following bug has been logged on the website:

Bug reference:      17427
Logged by:          Ahmed Tareque
Email address:      tareque.bracu@gmail.com
PostgreSQL version: 14.0
Operating system:   Windows
Description:       

Error :
SQL Error: 0, SQLState: 42846.
ERROR: cannot cast type bytea to bigint
could not extract ResultSet; SQL [n/a]; nested exception is
org.hibernate.exception.SQLGrammarException: could not extract ResultSet

Due to the presence of the Java stuff this doesn't qualify as a PostgreSQL bug report and thus this is the wrong place to post.

It is also unlikely to be an actual bug in any vendor software, rather it is likely that you just are not using the API correctly.  For questions of that nature an email to either the PostgreSQL -general list or a Java-oriented community is more useful, the latter being much more likely to find an audience that can assist you.

"AND (:tamTypeId is null or tap.id = cast(:tamTypeId AS
bigint))

The only way you get the aforementioned error is if PostgreSQL, when it executes this query, thinks that the value in the cast is of type bytea; and it will not matter whether the value is null or not.  But the logic as to how "cast(:tamTypeId as bigint)" is transformed into SQL that is sent to the server is completely outside the purview of PostgreSQL and as such, as noted above, outside the purview of this mailing list.

David J.

pgsql-bugs by date:

Previous
From: Julien Rouhaud
Date:
Subject: Re: BUG #17393: Delete database after recovery with point-in-time is still missing datafiles
Next
From: PG Bug reporting form
Date:
Subject: BUG #17428: last_value incorrect for uninitialized sequence