 			AND
 				hazard = 'Not affected'
 ;
-
+*/
 COMMIT;
 
 
-
+/*
 --Transaction to present the data in a file and on StdOut
 BEGIN;
 

	FORMAT CSV, DELIMITER ',', HEADER TRUE
	)
;
/*
SELECT
		sa_code,
		region_nam AS region,
		constitue1 AS constituency,
		lz_code || ': '  || lz_name || ' (' || lz_abbrev || ')' AS lz,
		hazard,
		zaf.tbl_ofa_sas.wg,
		soc_sec AS s,
--		pop_size,
		pop_curr,
		round(pop_curr * pc_pop * CAST( surv_def > 0.005 AS INTEGER), 0) AS pop_surv,
		round(pop_curr * pc_pop * CAST( lhood_def > 0.005 AS INTEGER), 0) AS pop_lhood,
		round(pop_curr * pc_pop * surv_def * 2100 / 3360.0 / 1000, 4) AS maize_eq,
		round(hh_curr * pc_pop * lhood_def, 0) AS lhood_nad
	FROM
		zaf.tbl_ofa_sas,
		(VALUES (1, 'very poor'), (2, 'poor'), (3, 'middle'), (4, 'rich'), (4, 'better off'), (4, 'better-off')) AS f (ordnum,wg)
	WHERE
		lower(zaf.tbl_ofa_sas.wg) = f.wg
	ORDER BY
		sa_code,
		hazard,
		s,
		f.ordnum
;*/

COMMIT;

/*
COPY (*/
SELECT
			row_name[1] AS region,
			row_name[2] AS constituency,

-- social security, hazard and outcome information
CREATE TABLE zaf.tbl_ofa_sas (
	tid serial primary key,
	the_geom geometry(multipolygon, 201100),
-- year and month of analysis (unique to each analysis event)
	ofa_year integer,
	ofa_month integer,
