To explain the situation, we intend to use the same codebase on both Oracle environments and PostgreSQL environments.
While most of our SQL primarily targets Oracle, it is expected to also work on PostgreSQL. We use the parser to translate the queries dynamically as they are requested.
We are concerned that we'd end up with recurring performance issues on PG due to the casts. As a starting point will we have to rewrite indexes to account for the casts? Will any index created in the future have to account fo them? Since on Oracle's end this won't be needed, different scripts for each dbms would beat our goal of becoming as DB agnostic as possible.
The casts are hidden to the developer, how predictable are they ? But say they weren't added, if a query is badly written and its castless translation is rendered pg-incompatible, the dev would from the start be aware of a casting issue and proceed to at least rewrite their oracle query to use an explicit cast. The casting will be visible and predictable.