1

I'm having an issue when comparing two strings. I see that, I can use "=" operator to compare two strings but I cannot use "<" and ">" operators to compare two strings

I have a scenario as below:

-- Prepare
CREATE FOREIGN TABLE onek2 (
  unique1   int4,
  unique2   int4,
  two     int4,
  four    int4,
  ten     int4,
  twenty    int4,
  hundred   int4,
  thousand  int4,
  twothousand int4,
  fivethous int4,
  tenthous  int4,
  odd     int4,
  even    int4,
  stringu1  text,
  stringu2  text,
  string4   text
) SERVER griddb_svr;


-- Scenario
explain (costs off)
select unique2 from onek2 where unique2 = 11 and stringu1 = 'ATAAAA';
      QUERY PLAN       
-----------------------
 Foreign Scan on onek2
(1 row)

select unique2 from onek2 where unique2 = 11 and stringu1 = 'ATAAAA';
 unique2 
---------
      11
(1 row)

explain (costs off)
select * from onek2 where unique2 = 11 and stringu1 < 'B';
      QUERY PLAN       
-----------------------
 Foreign Scan on onek2
(1 row)

select * from onek2 where unique2 = 11 and stringu1 < 'B';
ERROR:  GridDB-API is failed by 150018 at griddb_fdw.c: 2512
  Binary operation is not defined for the types STRING and STRING

explain (costs off)
select unique2 from onek2 where unique2 = 11 and stringu1 < 'B';
      QUERY PLAN       
-----------------------
 Foreign Scan on onek2
(1 row)

select unique2 from onek2 where unique2 = 11 and stringu1 < 'B';
ERROR:  GridDB-API is failed by 150018 at griddb_fdw.c: 2512
  Binary operation is not defined for the types STRING and STRING

Could you please help me to resolve this issue?

0 Answers0