Postgres: ERROR: value too long for type character varying(255) Does not specify the field

前端 未结 1 879
甜味超标
甜味超标 2021-01-22 01:46

I am getting this error occasionally and obviously I need to change the type from string to text, but the logs do not show which column is the culprit. Below is log from resque

相关标签:
1条回答
  • 2021-01-22 02:09

    This is years later and in Python/Django, but perhaps someone will find this useful:

    I work almost exclusively with large numbers of text files. I set up a dict to mirror the database columns, ie: dict['good_column']. Then in my try/except, I added that to the end of my logger.warning("You screwed something up: ".format(dict['good_column']). That way, the log tells me exactly where to look for the problem. I assume Ruby has some equivalent constructs to do this with.

    Hope that helps someone.

    0 讨论(0)
提交回复
热议问题