Query unable to utilize index without typecast to fixed length character

2023-04-06 Thread ahi
Hello, We have encountered an unexpected quirk with our DB and we are unsure if this is expected behaviour or an issue. PG version PostgreSQL 14.3 on aarch64-unknown-linux-gnu, compiled by aarch64-unknown-linux-gnu-gcc (GCC) 7.4.0, 64-bit schema of table in question and related indexes CREATE

Re: Query unable to utilize index without typecast to fixed length character

2023-04-07 Thread ahi
You are right we should move from character(N) to text, however the explicit typecast is also required for the numeric column not just the character one On Thu, Apr 6, 2023 at 4:50 PM Tom Lane wrote: > ahi writes: > > CREATE TABLE public.marketplace_sale ( > > log_index i