-d dbname--dbname=dbnameSpecifies the name of the database to connect to. This is equivalent to specifying dbname as the first non-option argument on the command line.
If this parameter contains an = sign or starts with a valid URI prefix (postgresql:// or postgres://), it is treated as a conninfo string. See Section 31.1.1, “Connection Strings”, in thedocumentation for more information.
Connect to database:
Method 1 : enter to db : sudo -u postgres psql
Connect to db : \c dbname
Method 2 : directly connect to db : sudo -u postgres psql -d my_database_name