pg sql structure  fix