#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2010
    Posts
    5
    Rep Power
    0

    LIKE operator doesn't work in TEXT columns


    Hello, everybody!

    I don't know if I'm missing something because I'm relatively new to PostgreSQL, but here it is:

    I have a TEXT column in a table. One of the rows has the value 'texto' in this column. So I'm trying to show this row with queries like these:

    Code:
    SELECT * FROM TABELA WHERE TEXT_COLUMN LIKE '%texto%'
    SELECT * FROM TABELA WHERE TEXT_COLUMN LIKE 'texto%'
    SELECT * FROM TABELA WHERE TEXT_COLUMN LIKE '%texto'
    and no rows are returned.

    What am I doing wrong? Doesn't we use the LIKE operator to search in TEXT columns in PostgreSQL?

    Thank you.

    Marcos
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2010
    Posts
    5
    Rep Power
    0
    Problem solved:

    community.jboss.org/thread/172100

    It was related to Hibernate, not Postgre. I just removed the @Lob annotation in the property and Hibernate saved the correct value in the column. Now the LIKE operator works as expected.

    Marcos

IMN logo majestic logo threadwatch logo seochat tools logo