[1.7.x] Fixed #22514 -- Prevented indexes on virtual fields [postgres].

Backport of 78c32f1caa from master