Re: TRIM bug

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: James Bellinger <james(at)illusorystudios(dot)com>, pgsql-odbc(at)postgresql(dot)org
Subject: Re: TRIM bug
Date: 2016-10-06 23:55:52
Message-ID: 8e9f68ea-d92c-4dd5-ca6c-fc62ed3de1a6@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

On 10/06/2016 04:42 PM, James Bellinger wrote:
> Hello,
>
> I just ran into this and narrowed it down to TRIM. Without the TRIM(),
> it works fine.
>
> In MS Access,
> SELECT DISTINCT [Name] FROM [Customer Information] WHERE [Name] IS NOT
> NULL AND LEN(TRIM([Name])) > 1 ORDER BY [Name] ASC;
> becomes
> SELECT DISTINCT "public"."Orders"."Name" FROM ("public"."Orders" LEFT
> OUTER JOIN "public"."POs" ON ("public"."Orders"."OnlineCode" =
> "public"."POs"."OnlineCode" ) ) WHERE (NOT(("public"."Orders"."Name" IS
> NULL ) ) AND (char_length(ltrim(rtrim("public"."Orders"."Name" )))))> 1
> ) ) ORDER BY "public"."Orders"."Name"
> As you can see, there is an extra right parenthesis. (Customer
> Information is an Access query onto Orders, in case the name change is
> confusing from my test example.)

Access version?

psqlobdc version?

Postgres version?

Is this being generated by the Access query builder?

What if you do a Pass-Though query?

Where are fetching the final query text from?

SELECT
DISTINCT "public"."Orders"."Name"
FROM (
"public"."Orders"
LEFT OUTER JOIN "public"."POs" ON (
"public"."Orders"."OnlineCode" = "public"."POs"."OnlineCode" ) )
WHERE (
NOT (
(
"public"."Orders"."Name" IS NULL ) )
AND (
char_length (
ltrim (
rtrim (
"public"."Orders"."Name" ) ) ) ) )
> 1 ) )
ORDER BY
"public"."Orders"."Name"

I count two extra right parentheses.

>
> Thanks!
>
> James
>
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

  • TRIM bug at 2016-10-06 23:42:28 from James Bellinger

Responses

Browse pgsql-odbc by date

  From Date Subject
Next Message Adrian Klaver 2016-10-07 04:55:19 Re: TRIM bug
Previous Message James Bellinger 2016-10-06 23:42:28 TRIM bug