I am working with Postgresql database and Java. I am trying to insert into Postgresql database using prepared statement so I am using Batch insert as well. And I am trying to insert 1000 records at a time.
And below is the exception I am getting when I am trying to insert into one of my tables in batches.
java.sql.BatchUpdateException: Batch entry 0 INSERT into data_week (name, address, version, type, size, fax, phone) values('helloooooo', '360 S', '5.0beta4', NULL, '-1', '673', '300') was aborted. Call getNextException to see the cause.
Does anyone know what does thise error means? And also, can I use batch insert for Postgresql database or not?
EDIT: Below is my schema for the table data_week
CREATE TABLE data_week
(
name character varying(256),
address character varying(256),
version character varying(256),
type integer,
size integer,
fax character varying(256),
phone integer,
created_date timestamp without time zone NOT NULL DEFAULT (now() - '7 days'::interval),
updated_date timestamp without time zone NOT NULL DEFAULT now()
)
INSERT into data_week (name, address, version, type, size, fax, phone) values('helloooooo', '360 S', '5.0beta4', NULL, '-1', '673', '300')
– Anthony Atkinson Mar 31 '14 at 3:03COPY
instead). – Craig Ringer Mar 31 '14 at 3:09getNextException()
as suggested by the error message? If yes, what did the next exception contain? – a_horse_with_no_name Mar 31 '14 at 8:12