properly using pg