Re: BUG #17427: ERROR: cannot cast type bytea to bigint

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: tareque(dot)bracu(at)gmail(dot)com, PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #17427: ERROR: cannot cast type bytea to bigint
Date: 2022-03-06 23:35:28
Message-ID: CAKFQuwaK439fhf+OqF5q9kp7h6F2rZD78NLNqjtpxchwF1=M=g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Sun, Mar 6, 2022 at 4:14 PM PG Bug reporting form <noreply(at)postgresql(dot)org>
wrote:

> The following bug has been logged on the website:
>
> Bug reference: 17427
> Logged by: Ahmed Tareque
> Email address: tareque(dot)bracu(at)gmail(dot)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.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2022-03-07 00:31:33 BUG #17428: last_value incorrect for uninitialized sequence
Previous Message Julien Rouhaud 2022-03-06 07:41:34 Re: BUG #17393: Delete database after recovery with point-in-time is still missing datafiles