Html type store in postgresql result in byte

364 views
Skip to first unread message

chenwl

unread,
Mar 20, 2012, 10:32:59 AM3/20/12
to Yesod Web Framework
With yesod-0.10.1

Definition:

postBlogR :: Handler RepHtml
postBlogR = do
((res, articleWidget), enctype) <- runFormPost entryForm
case res of
FormSuccess article -> do
articleId <- runDB $ insert article
setMessage $ toHtml $ (articleTitle article) <> " created"
redirect $ ArticleR articleId
_ -> defaultLayout $ do
setTitle "Please correct your entry form"
$(widgetFile "articleAddError")
Database

Article
title Text
content Html
deriving
I get \x48656c6c6f2c20776f726c6421 in database if I post Hello, world!
Also it present as '\x48656c6c6f2c20776f726c6421' in web page.

I've tried mongodb and sqlite, both works as expect. Postgresql is
strange.


Michael Snoyman

unread,
Mar 20, 2012, 10:34:23 AM3/20/12
to yeso...@googlegroups.com
This was a bug in earlier versions of the persistent package. It
should be solved in the most recent release (0.8.0.2). Can you try
upgrading to that and see if the problem persists?

Michael

陈文龙

unread,
Mar 20, 2012, 10:45:48 AM3/20/12
to yeso...@googlegroups.com
Thanks, I'll try

2012/3/20 Michael Snoyman <mic...@snoyman.com>

陈文龙

unread,
Mar 20, 2012, 11:00:28 AM3/20/12
to yeso...@googlegroups.com
After upgrade persistent to 0.8.0.2, it is fixed.

I am curious what cause the bug. Why only postgresql affected?

2012/3/20 陈文龙 <qzch...@gmail.com>

Michael Snoyman

unread,
Mar 20, 2012, 11:02:30 AM3/20/12
to yeso...@googlegroups.com
You can see the previous discussion here:
http://groups.google.com/group/yesodweb/browse_thread/thread/54cee822675f5857/6d305b5dd96d026c?hl=en_US&lnk=gst&q=postgresql#6d305b5dd96d026c

Go towards the bottom to see the actual problem and its resolution.

Michael

Reply all
Reply to author
Forward
0 new messages