We are experiencing some issues querying our Postgres database (version 13.1, driver: 9.4.1212) since it gives us the error shown on the following image:
The error message, translated from Italian, says: column index, 1, is higher than the number of index 0 columns. This happens when we use the cfqueryparam tag in the where condition (as shown in the image below).
On the other hand, if we specify the param value (e.g. genreId = 2), all goes smoothly.
It could be helpful to know that such error turns out only when cfqueryparam is used inside a jsonb function (such as jsonb_path_exists). When used outside, it works properly.
<cfquery name="local.q" datasource="test"> SELECT data as book_field FROM books WHERE json_path_exists(data, '$.genres.name ? (@ == <cfqueryparam value="#arguments.genreId#" sqltype="varchar"> )'); </cfquery>
Assuming it could depend on the fact that we used an archived driver and deciding to update it, we downloaded from PostgreSQL JDBC Download
and positioned it in ‘.\lucee-188.8.131.52\WEB-INF\lucee-server\bundles’. Nonetheless, although we can see the driver is present in the directory it doesn’t get loaded as it can be seen in the image below.
Version 42.2.19 is the driver we want our program to use, but it gets overwritten by the previous one (version 9.4.1212). We tried to remove the older version, but it gets imported anyway.
We tried to specify the exact version in our Application.cfm and yet the problem still stands. Image below shows our datasource and our attempt to do as described above.
We don’t know if updating the driver is going to solve our main problem, still we would like to do it in order to keep our application as updated as possible.
We thank you in advance for all the help you will be able to give us.
Lucee Version: 184.108.40.206