כיצד לאפס סיסמה עבור משתמשים במסד נתונים של PostgreSQL

What problem are you solving? Why not have them use the reset password link and set it themselves?

I would do it from the rails console rather than sql. I would have to look at the source to get the code.