Re: SELECT query fails after pg_upgrade as the conditional operator fails - Mailing list pgsql-admin

From Juan José Santamaría Flecha
Subject Re: SELECT query fails after pg_upgrade as the conditional operator fails
Date
Msg-id CAC+AXB2qE9ZF8MZZ=OSEfg6ufKuGBn-6ZzNwT-iAJhE5UHOh7g@mail.gmail.com
Whole thread Raw
In response to SELECT query fails after pg_upgrade as the conditional operator fails  (Nithin Johnson <nithin.johnson@altair.com>)
Responses RE: SELECT query fails after pg_upgrade as the conditional operatorfails  (Nithin Johnson <nithin.johnson@altair.com>)
List pgsql-admin

The following query fails:

SELECT * from table where jobid = 'foo';

 

Whereas the following is passing:

SELECT * from table where jobid LIKE '%foo';

SELECT * from table where trim(jobid) = 'foo';

 

We were suspecting some leading invisible characters before 'foo'. but the following queries went well:

SELECT left(jobid, 1) from table where jobid LIKE '%foo';

SELECT ascii(jobid) from table where jobid LIKE '%foo';


Please post the error code, also the plan for the different queries and the description of the table.

Can you check if rebuilding the table's indexes solves the issue? If so, send output of that operation.

Regards,

Juan José Santamaría Flecha

pgsql-admin by date:

Previous
From: Nithin Johnson
Date:
Subject: SELECT query fails after pg_upgrade as the conditional operator fails
Next
From: bricklen
Date:
Subject: Re: LDAP security connection