How to correctly escape characters in command-line PostgreSQL query?
[servername]# su postgres -c 'cd ~; psql -c "SELECT * FROM pg_catalog.pg_user WHERE usename LIKE name;"' ERROR: column "name" does not exist LINE 1: SELECT * FROM pg_catalog.pg_user WHERE usename LIKE name; ^ Tried vary ways but no one of…