Random Postgres hints 

$ hint postgres
postgres psql csv:
COPY ( query ) TO STDOUT WITH CSV HEADER;

postgres zero padded unsigned integer:
SELECT to_char(e.polarea_code, 'FM09') AS polarea_code