Sunday, July 25, 2010

DatabaseError: subquery has too many columns

Hi all,

Just came across this error.

class Test(models.Model):
name = models.CharField(max_length=20)

test = Test(name='bob')
test.save()
pks = Test.objects.none().values('pk').query
print Test.objects.exclude(pk__in=pks)

DatabaseError: subquery has too many columns

The query:

SELECT
"error_test"."id",
"error_test"."name",
FROM
"error_test"
WHERE
NOT (
"error_test"."id"
IN (
SELECT
"error_test"."id",
"error_test"."name",
FROM
"error_test"
)
)

Same thing happens when:

print Test.objects.filter(pk__in=pks)

Should this be ticketed? Should I tweak the app to ensure this doesn't
happen?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate