sudo -u postgres switches to the OS user that owns the cluster, so peer authentication admits you as the postgres superuser without a password. -d postgres targets the maintenance database and -c runs a single statement. The standard entry point before application roles exist.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.