Trying to setup Postgresql 9.5 with different data directory
The command I typed:

sed -i 's#.*data_directory = .*#data_directory = "/blah/data"#' /etc/postgresql/9.5/main/postgresql.conf


should be:

sed -i "s#.*data_directory = .*#data_directory = '/blah/data'#" /etc/postgresql/9.5/main/postgresql.conf


The quotes around the directory path were the wrong sort. Can you believe it!