update trends controller for postgres