feat(database): improve pg array conversion (refs #2761)