<?php $conn = pg_pconnect("dbname=publisher"); if (!$conn) { echo "An error occured.\n"; exit; } if (!pg_ping($conn)) die("Connection is broken\n");?>