skip to Main Content

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 '~'; 

2

Answers


  1. 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.

    Login or Signup to reply.
  2. 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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search