All rebased and tested
--Ivan KartyshovPostgres Professional: http://www.postgrespro.comThe Russian Postgres Company(at)postgrespro(dot)ru>