making RDB conversion for postgresql
fixed a bug in which foreign keys were generated wrongly
made postgresql specific sql scripts