The postgres docs say that PHP should never be able to return PGRES_NONFATAL_ERROR
"A result of status PGRES_NONFATAL_ERROR will never be returned directly by PQexec or other query execution functions" http://www.postgresql.org/docs/current/static/libpq-exec.html
Therefore you cannot use this function to check if this query produced a notice.