【发布时间】:2021-12-31 05:06:35
【问题描述】:
问题:尝试将 JSON 字符串插入 json 数据类型的 Postgres 表列会间歇性地在某些记录插入尝试中返回此错误,但在其他尝试中不返回此错误。
我使用多个第三方“JSON 验证器”应用程序确认我插入的 JSON 确实有效,并且我已经确认任何单个 ' 引号字符都已使用双 '' 技术转义,并且问题持续存在。
还有哪些需要考虑的其他故障排除步骤?
这是我尝试过的一个清理过的 JSON 示例:
{"id": "jf4ba72kFNQ","publishedAt": "2012-09-02T06:07:28Z","channelId": "UCrbUQCaozffv1soNdfDROXQ","title": "Scout vs. Witch: a tale of boy meets ghoul (Official Version)","tags": ["L4D","TF2","SFM","animation","zombies","Valve","video game"],"description": "Howdy folks (he''s alive!). I made a new SFM video (October 2015), called \"Nick in a Hotel Room\". Please check it out: https://www.youtube.com/watch?v=FOCTgwBIun0\n\nAlso check out some early behind the scenes of Scout vs. Witch:\nhttps://www.youtube.com/watch?v=73tQEBgD09I\n\nYou can find links to my stuff on my website: http://nailbiter.net\n\n-----\n\nhey gang,\nI''m the animator who made this cartoon. Hope you like it.\n\nThis is my little mash-up of a bunch of stuff I like. What happens when the Scout from Valve''s Team Fortress 2 video-game walks into the wrong neighborhood (Left 4 Dead). Hilarity (and a bodycount) ensues. It was created using Source Film Maker (for all the dialog stuff and the montage at the beginning), and with TF2/Source SDK for the entire 300 alley-run sequence. I had already completed that part before SFM was released. The big zombie horde scenes and a couple others were shot in Left 4 Dead. I hope you get a kick out of it.\n\nStuff I did:\nI animated all of the characters (using Maya) except for the big crowd scenes and parts of the headcrab zombie (the crawling and the legs). The faces in the dialog scenes were animated in SFM.\n\nAlso did additional mapping, particles, motion graphics, zombie maya rigging, and created blendshapes for the Witch''s face to enable her to talk/emote. I didn''t do a full set, just the phonemes I needed for this performance. Inspiration for her performance was based on Meg Mucklebones (if you''ve ever seen Legend) mixed with the demon ladies in Army of Darkness. I have a feeling Valve had seen those movies too when they designed her..\n\nthanks for watching."}
【问题讨论】:
-
可以发个例子吗?
-
@Jellyboy 谢谢,我分享了一个例子。另外,我回答了这个问题,这是我一直在寻找的东西,但找不到任何连贯的答案来回答我的问题(至少,不是以我询问或搜索的方式),所以我自己写了!跨度>
-
你的例子对我有用。如果你擦洗的是错误的原因,那就是违背了目的。错误消息的文本通常会提供有关问题所在和位置的良好信息。但是json越大,越难根据消息找到错误。
标签: sql json postgresql