Psycopg2 using wildcard causes TypeError

后端 未结 2 752
轮回少年
轮回少年 2020-12-19 08:48

Currently I am attempting to search a database to grab certain events. My query is as such

SELECT * FROM events WHERE summary ILIKE E\'%test%\' AND start_tim         


        
2条回答
  •  庸人自扰
    2020-12-19 09:04

    Not sure if this is the full root of your problem, but I think you need to escape your wildcards or the parameterization logic will get confused.

    SELECT * FROM events WHERE summary ILIKE E'%%test%%' AND start_time > %(begin)s 
    

    I think %% is the correct escaping, but it could be \%

提交回复
热议问题