CREATE TABLE: ------------- CREATE TABLE public.bulkreptest ( route integer NOT NULL, dtg timestamp without time zone NOT NULL, issue_dtg timestamp without time zone NOT NULL, insert_dtg timestamp without time zone, just_a_number numeric(4,2) CONSTRAINT pk_bulkreptest PRIMARY KEY (route , issue_dtg , dtg ) ) WITH ( OIDS=FALSE ); ALTER TABLE public.bulkreptest OWNER TO postgres; GRANT ALL ON TABLE public.bulkreptest TO postgres; CREATE BULKLOAD FILTER: ----------------------- CREATE OR REPLACE FUNCTION public.bulkreptest_filter(integer, timestamp without time zone, timestamp without time zone, timestamp without time zone, numeric) RETURNS record AS $BODY$ SELECT $1, $2, $3, now(), $5 $BODY$ LANGUAGE sql VOLATILE COST 100; ALTER FUNCTION public.bulkreptest_filter(integer, timestamp without time zone, timestamp without time zone, timestamp without time zone, numeric) OWNER TO postgres; CREATE BULKLOAD CONFIG FILE: (change db name) --------------------------------------------- OUTPUT = *YOUR_DB_NAME*.public.bulkreptest TYPE = CSV QUOTE = "\"" ESCAPE = \ DELIMITER = "," LOADER = BUFFERED ON_DUPLICATE_KEEP = NEW DUPLICATE_ERRORS = -1 FILTER = *YOUR_DB_NAME*.public.bulkreptest_filter CREATE LOAD DATA FILE: ---------------------- 100,2012-12-13 10:00,2012-12-13 10:00,,1.498 100,2012-12-13 11:00,2012-12-13 10:00,,2.599 100,2012-12-13 12:00,2012-12-13 10:00,,3.426 100,2012-12-13 13:00,2012-12-13 10:00,,3.935 100,2012-12-13 14:00,2012-12-13 10:00,,4.008 100,2012-12-13 15:00,2012-12-13 10:00,,3.417 100,2012-12-13 16:00,2012-12-13 10:00,,2.507 100,2012-12-13 17:00,2012-12-13 10:00,,1.956 100,2012-12-13 18:00,2012-12-13 10:00,,1.699 100,2012-12-13 19:00,2012-12-13 10:00,,1.944 BULKLOAD COMMAND: ----------------- /usr/pgsql-9.1/bin/pg_bulkload -d *YOUR_DB_NAME* -i /path/to/data/file.txt /path/to/load/config.cfg 2>> /path/to/load/logfile.log SQL COMMAND: ------------ On the primary node select * from bulkreptest where issue_dtg>='2012-12-12 00:00' and issue_dtg<='2012-12-14 00:00' order by route,issue_dtg,dtg 100;"2012-12-13 10:00:00";"2012-12-13 10:00:00";"2012-12-13 11:46:31.097496";1.498 100;"2012-12-13 11:00:00";"2012-12-13 10:00:00";"2012-12-13 11:46:31.097496";2.599 100;"2012-12-13 12:00:00";"2012-12-13 10:00:00";"2012-12-13 11:46:31.097496";3.426 100;"2012-12-13 13:00:00";"2012-12-13 10:00:00";"2012-12-13 11:46:31.097496";3.935 100;"2012-12-13 14:00:00";"2012-12-13 10:00:00";"2012-12-13 11:46:31.097496";4.008 100;"2012-12-13 15:00:00";"2012-12-13 10:00:00";"2012-12-13 11:46:31.097496";3.417 100;"2012-12-13 16:00:00";"2012-12-13 10:00:00";"2012-12-13 11:46:31.097496";2.507 100;"2012-12-13 17:00:00";"2012-12-13 10:00:00";"2012-12-13 11:46:31.097496";1.956 100;"2012-12-13 18:00:00";"2012-12-13 10:00:00";"2012-12-13 11:46:31.097496";1.699 100;"2012-12-13 19:00:00";"2012-12-13 10:00:00";"2012-12-13 11:46:31.097496";1.944 On the secondary node: select * from bulkreptest where issue_dtg>='2012-12-12 00:00' and issue_dtg<='2012-12-14 00:00' order by route,issue_dtg,dtg ERROR: could not read block 0 in file "base/28227/77139": read only 0 of 8192 bytes ********** Error ********** ERROR: could not read block 0 in file "base/28227/77139": read only 0 of 8192 bytes SQL state: XX001 select count(*) from bulkreptest 10