Hi, the postgres adapter has been updated since 2.9.4, in addition at least 
one patch involves json support, see here
 
https://github.com/web2py/web2py/commit/c4a4ee27c42e4e3b2458981888d6db6400657006
I suggest updating web2py

Paolo


On Wednesday, December 10, 2014 5:52:46 PM UTC+1, Manuele wrote:
>
>  Hi *,
> I get this error just in the production server not in the development one 
> when I try to insert a record to a database table with a json column/field.
>
> Traceback (most recent call last):
>   File "/var/www/.../web2py/gluon/restricted.py", line 217, in restricted
>     exec ccode in environment
>   File "/var/www/.../web2py/applications/teleservice/controllers/auth.py" 
> <https://borri2.valis-e.com/admin/default/edit/teleservice/controllers/auth.py>,
>  line 249, in <module>
>   File "/var/www/.../web2py/gluon/globals.py", line 385, in <lambda>
>     self._caller = lambda f: f()
>   File "/var/www/.../web2py/gluon/tools.py", line 3259, in f
>     return action(*a, **b)
>   File "/var/www/.../web2py/applications/teleservice/controllers/auth.py" 
> <https://borri2.valis-e.com/admin/default/edit/teleservice/controllers/auth.py>,
>  line 56, in new_user
>     user_id = db.auth_user.insert(**db.auth_user._filter_fields(form.vars))
>   File "/var/www/.../web2py/gluon/dal.py", line 9114, in insert
>     ret =  self._db._adapter.insert(self, self._listify(fields))
>   File "/var/www/.../web2py/gluon/dal.py", line 1360, in insert
>     raise e
> DataError: invalid input syntax for type json
> LINE 1: ...assword,registration_key,email,job_title) VALUES ('{''provin...
>                                                              ^DETAIL:  Token 
> "'" is invalid.CONTEXT:  JSON data, line 1: {'...
>
>
> Where do you think I have to look for what cause the problem?
> On both the architectures I have the same psycopg (v. 2.5.3) and 
> postgreSQL (v. 9.3) versions... but not the same framework version:
>
> * on development server: 2.10.0-beta+timestamp.2014.10.16.15.58.50
> (Running on Rocket 1.2.6, Python 2.7.5+)
>
> * on production server: 2.9.4-stable+timestamp.2014.03.04.22.40.54
> (Running on Apache/2.2.22 (Debian), Python 2.7.3)
>
> could it be the solution to use an updated web2py version? Is there a 
> possible patch or different solution for that?
>
> Thank you
>
>     Manuele
>  

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to