mock to postgresql

8 views
Skip to first unread message

TX

unread,
Nov 14, 2016, 9:24:14 AM11/14/16
to chicagoboss
Hi,

I am deploying my application, when creating database in postgresql, I defined many fields, like people's name, as varchar. The problem is, in mock, for example, when I read name = Req:post_param("name") from user input, save, then read out, it was string, let's say, "John", while in postgresql, when I read it out, it was binary: <<"John">>, is_binary() tested to be true, is_list() tested to be false.

I worked on mock before so my code is based on string, now I have to revise quite a lot of code as <<"John">> == "John" will return false. Before I revise, anyone encountered the same problem? Is there anyway to force postgresql to save as list instead of binary?

My environment is: CentOS X86_64 6.4, erlang 17.5.3, chicagoboss v0.8.19, postgresql 9.6.

Appreciate.

Reply all
Reply to author
Forward
0 new messages