avoid pgsql error on editing source (Fix #561)
Merge pull request #567 from niol/fix-for-561

avoid pgsql error on editing source (Fix #561)