2

I am using south and django on a new site with a postgres database. I am attempting to do the initial migration but get the following error

django.db.utils.DatabaseError: invalid input syntax for integer: ""

when this line is called

('views', self.gf('django.db.models.fields.IntegerField')(default=0)),

which translates to this in the model

views = models.IntegerField(default=0)

This all works fine with sqllite locally, anyone know why this is happening?

1
  • For some reason setting the default to 1 fixed the issue Commented Sep 17, 2011 at 0:07

1 Answer 1

2

As you mentioned in your comments, setting the default to 1 fixed the problem. I understand you'd like some idea of why.

sqlite stores most data as strings, so '' is a perfectly valid value there. PostgreSQL provides strict checking so you can't send '' but NULL is acceptable.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.