Ported CreateTiePerspectives template to postgresql [Aergo-551]