<?php $dbconn = pg_connect("dbname=publisher") or die("Could not connect"); echo "Server encoding: ", pg_parameter_status($dbconn, "server_encoding");?>
The above example will output:
Server encoding: SQL_ASCII