Home > Back-end >  SQL Error [23514]: ERROR: new row for relation
SQL Error [23514]: ERROR: new row for relation

Time:12-08

While copying the data from a CSV file it's throwing the issue as:

SQL Error [23514]: ERROR: new row for relation

The location of the CSV file and the table name have been checked.

I have tried using different delimiter which also ends up with the same error.

copy groups from 'C:/test.csv' DELIMITER '~'; 

CodePudding user response:

Grepping the PostgreSQL source, I assume that the error message really was:

new row for relation "%s" violates check constraint "%s"

You look at the definition of the constraint and the new row, then it will become clear why the error was thrown.

CodePudding user response:

According to the list of Postgres error-codes the error code 23514 means "check violation". So you should visit all the CHECK constraints defined on your table and find out, what the problematic constraint checks.

Note that the name of the constraint as well as the offending row are usually mentioned in the error message. It looks like you only posted part of it.

  • Related