SELECT password, public.crypt('abc', password) = password FROM table WHERE email = 'xxx@a.com'; UPDATE table SET password=public.crypt('abc', public.gen_salt('bf', 8)) WHERE id = 'aaa';