If you set process name to something containing \0 you will not be able to connect to postgres.
Easy to reproduce:
2.0.0-p247 :007 > $0 = "foo bar\0"
=> "foo bar\u0000"
2.0.0-p247 :008 > require 'pg'; PGconn.connect(dbname: "postgres")
PG::ConnectionBad: unterminated quoted string in connection info string