On Wed, Aug 3, 2011 at 5:08 PM, Didymus <tommy.tom...@gmail.com> wrote:
...
> ERROR:  invalid input syntax for integer: ""
> CONTEXT:  COPY train_emp, line 1, column phone: ""
...
> I have tried the following code in models.py
>
> phone  = models.IntegerField(blank=True)
> phone  = models.IntegerField(null=True)
> phone  = models.IntegerField(null=True, blank=True).

blank=True affects only model validation, which is a separate layer
than the database.

null=True allows nulls, but "" is not the same as null (at least in PostgreSQL).

I think this may be a question for the postgres mailing list since
this has little to do with django, but to be helpful, perhaps you are
using the import command incorrectly?  You didn't list the command you
run, but here's a reference:
http://www.postgresql.org/docs/8.2/static/sql-copy.html

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to