Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8101967
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T23:07:04+00:00 2026-06-05T23:07:04+00:00

I recently migrated a django project from mysql to postgresql and in the process

  • 0

I recently migrated a django project from mysql to postgresql and in the process broke a filter that was being used. The old filter looked like this:

return (model_class.objects.filter(status='0',ir=1).count() * 2) +
model_class.objects.filter(status='1',ir=1).count() 

However, that now produces an error that states:

 DatabaseError at /report/trip/publication
 operator does not exist: integer = boolean
 LINE 1: ...AND "publication"."ir" = true )
                               ^
 HINT:  No operator matches the given name and argument type(s). 
 You might need to add explicit type casts.

I’ve tried setting ir = ‘1’, and I’ve even tried setting it to ‘3’ (why the hell not?), but regardless of what I set it to, it keeps throwing the same error message, which seems to imply that something else is gunking it up. I did set it to “return None” and that gave me an unfiltered list. The only possible conflict I could see is that there is a declaration up top, but it shouldn’t be an issue (it wasn’t before):

 class Publication(Unit):  
    ir = models.BooleanField(default=False,null=False,verbose_name="Is IR")

My postgres database has these fields with the following datatypes:

 status  | character varying
 ir      | integer

Needless to say, I am extremely confused. I didn’t set this up – I’m only trying to fix it (and learn something in the process). What is the proper way to filter this? Any feedback would be appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T23:07:05+00:00Added an answer on June 5, 2026 at 11:07 pm

    In Postgres, a BooleanField is of type “boolean”.

    Quick fix is to change the column in Postgres.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I recently migrated from a PostgreSQL database to a SQL Server database. To switch
I recently migrated a database from mysql to pgsql 9. But now when I
I recently migrated my web services from Axis to CXF (2.1). It appears that
I've recently migrated my CI server from an old version of CruiseControl to Hudson.
I recently migrated my Qt project from Linux to Vista, and now I'm debugging
I recently migrated to Netbeans 7.0(with glassfish 3.1) from 6.9(with glassfish 3.0). After that
I recently migrated my JSF app(using primefaces) from glassfish 3.1 to tomcat7 server. Previously
We have a 3.5 Gb SVN repository recently migrated from a 6 Gb one.
Possible Duplicate: Equivalent of SQL ISNULL in LINQ? I am recently migrated from ADO.Net
Recently we migrated from VSS to SVN. But I don't want VSS removed totally,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.