Draft of script for MCDB data query with postgresql.