Skip to main content

Hi,

I'm trying to write data into a PostGIS database. However, I get the following error:

Bulk copy failed on table 'schemaname.dataset' * using delimiter ':'. Error was 'ERROR: value too long for type character varying(3)

CONTEXT: COPY dataset, line linenumber, column columnname : "attributevalue"

A fatal error has occurred. Check the logfile above for details

Bulk copy failed on table 'schemaname.dataset' using delimiter ':'. Error was 'no COPY in progress

The type character of the column is not set to have a width of only 3. But I keep getting this (or other similar errors).

I have tried multiple things:

- Using CSV instead of Excel as a datasource

- Increasing the width of the attributes

- Changing the type of the attributes ( text or string instead of varchar) of both the reader (input) and output (writer)

With the Excel file I would get a similar error, but on a different column and line. with the CSV it gets stuck.

I have to note that only a schema was implemented within the database, and nothing else.

*NB: I have anonymized the error for this post.

Did you check the width of the column in pgAdmin?

What is your table handling parameter set at? I suspect it is at "Create If Needed". With this setting, once the table is created, it won't be changed the next time you write the data.

Changing the attribute width in FME won't change anything anymore, unless you change the parameter to "Drop and Create".


Did you check the width of the column in pgAdmin?

What is your table handling parameter set at? I suspect it is at "Create If Needed". With this setting, once the table is created, it won't be changed the next time you write the data.

Changing the attribute width in FME won't change anything anymore, unless you change the parameter to "Drop and Create".

Ye,s I have checked the width, and have changed it, too. But I keep getting the same error.

 

Yes, the table handling parameter is set at "create if needed". Do I need to change it to drop and create??

 


Ye,s I have checked the width, and have changed it, too. But I keep getting the same error.

 

Yes, the table handling parameter is set at "create if needed". Do I need to change it to drop and create??

 

"Drop and Create" will literally drop (read remove) the table. As long as you are in a developing environment and the data in the table is no production I would use "Drop and Create".
Ye,s I have checked the width, and have changed it, too. But I keep getting the same error.

 

Yes, the table handling parameter is set at "create if needed". Do I need to change it to drop and create??

 

I think you should post the similar errors as well. This error (value too long for type character varying(3)) suggests there is a column with a width of character varying(3) and you say there isn't.

 

 

So maybe you solved this error by changing the width and now there are similar errors that must be fixed as well or you are writing to the wrong connection, schema or table?

 

 

Or something strange is happening and the database is giving an error that isn't there?

 


I think you should post the similar errors as well. This error (value too long for type character varying(3)) suggests there is a column with a width of character varying(3) and you say there isn't.

 

 

So maybe you solved this error by changing the width and now there are similar errors that must be fixed as well or you are writing to the wrong connection, schema or table?

 

 

Or something strange is happening and the database is giving an error that isn't there?

 

Hi, that wat indeed the case, but I had set the table handling to "create if needed" and not to "drop and create". That's why the problem kept persisting even after I had changed the width of the conflicting clumn. Thanks for your input.

 

 


Reply