fixed rebuild for postgres