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 530183
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T09:10:13+00:00 2026-05-13T09:10:13+00:00

I have quite long query with ‘Q()’, with Sqlite3 works very well, but with

  • 0

I have quite long query with ‘Q()’, with Sqlite3 works very well, but with postgresql or mysql I have strange error e.g. for postgresql: invalid input syntax for integer: "("
and for mySQL: Truncated incorrect DOUBLE value: '('

How could I run that query with mysql? Where is my mistake?

Here is that query:

    watchersTuple = self.getWatchers()
    tagsTuple = self.getTags()
    blockedUserTuple = self.getBlockedUser()
    blockedTagTuple = self.getBlockedTag()

    statuses = Status.objects.filter( (Q(author__in = str(watchersTuple)) | Q(tags__in = str(tagsTuple)) | Q(author = self) | Q(recipient = self)) & ~Q(author__in = str(blockedUserTuple)) & ~Q(tags__in = str(blockedTagTuple)) ).distinct()
  • 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-05-13T09:10:13+00:00Added an answer on May 13, 2026 at 9:10 am

    You haven’t posted your models, but it looks like author is an integer field, or maybe a foreign key. In which case, why are you using str on the tuple of values? You presumably want to check whether author is one of those values. So just remove the str call.

    The reason it appears to work in sqlite is that sqlite ignores field types – strings and integers are treated the same. Other DBMSs are more strict.

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

Sidebar

Related Questions

this is probably trivial, but i have a quite long sql query and echo
I have been using Visual Studio 2008 quite long but lately I am getting
I have the following code (Yes I know it's quite long winded, but I
I have to run some mysql update queries and they take quite a long
I have this quite long query that should give me some information about shipments,
I'm having trouble with a stubborn MySQL query. It's a quite long and complex
I have a query that is quite long and takes a few seconds to
I have quite a long query that is causing me some problems. For the
I have a JavaScript function which is quite long and performs a number of
I have a radio button list and some of the labels are quite long

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.