Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects versions: None
    • Fix versions: None
    • Components: None
    • Labels:
    • Sprint:

      Description

      The postgresql SIMILAR TO function is fully compatible with LIKE but additionally it supports some regular expressions.

      http://www.postgresql.org/docs/8.4/static/functions-matching.html#FUNCTIONS-SIMILARTO-REGEXP

      With this simple patch:

      diff -r 2fbfe2612bde org.compiere.db.postgresql.provider/src/org/compiere/dbPort/ConvertMap_PostgreSQL.java
      --- a/org.compiere.db.postgresql.provider/src/org/compiere/dbPort/ConvertMap_PostgreSQL.java	Wed Apr 16 09:17:02 2014 -0500
      +++ b/org.compiere.db.postgresql.provider/src/org/compiere/dbPort/ConvertMap_PostgreSQL.java	Wed Apr 16 10:06:49 2014 -0500
      @@ -47,6 +47,7 @@
       		s_pg.put("\\bBLOB\\b",                  "BYTEA");                 //  BLOB not directly supported
       		s_pg.put("\\bCLOB\\b",                  "TEXT");                //  CLOB not directly supported
       		s_pg.put("\\bLIMIT\\b","\"limit\""); 
      +		s_pg.put("\\bLIKE\\b","SIMILAR TO");  // replace the LIKE for the stronger SIMILAR TO
       		s_pg.put("\\bACTION\\b","\"action\""); 
       		s_pg.put("\\bold\\b","\"old\""); 
       		s_pg.put("\\bnew\\b","\"new\""); 
      

      I was able to make it work.

      It would be good to add this to iDempiere? Configurable?

      WDYT?

      Regards,

      Carlos Ruiz

        Attachments

          Activity

            People

            • Assignee:
              carlosruiz_globalqss Carlos Ruiz
              Reporter:
              carlosruiz_globalqss Carlos Ruiz
            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: