How to assign a parameter/argument in postgres psql UPDATE command. I tried with the following command.
c="openssl rand -base64 6"
ab=eval $c
psql -d db_name -c "UPDATE table_name SET password = '$ab' WHERE name = 'cde'"
The above command updates the table 'table_name' in the colum 'password' as ' ' (quotes with empty string)instead of updating the value of '$ab'. The '$ab' is a string.
Could anyone help on this?