kore: make postgresql an optional dependency.

Closes #34969.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>