ActiveRecord::StatementInvalid: PG InFailedSqlTransaction

后端 未结 10 2075
礼貌的吻别
礼貌的吻别 2020-12-13 01:33

I am trying to create an ActiveRecord Object.But I\'m getting this error while creating it.

(0.1ms)  ROLLBACK
ActiveRecord::StatementInvalid: PG::InFailedSql         


        
10条回答
  •  执念已碎
    2020-12-13 01:57

    Problem:

    1. The program executes incorrect SQL statement. Incorrect SQL statement is root cause of the problem.
    2. The program does not ROLLBACK or RELEASE SAVEPOINT immediately after incorrect SQL statement.
    3. The program executes SQL statements after incorrect SQL statement.
    4. PostgreSQL raises ERROR: Current transaction is aborted, commands ignored until end of transaction block

    Solution:

    Find incorrect SQL statement and correct it. If you don't want to correct the SQL statement, use ROLLBACK or RELEASE SAVEPOINT after incorrect SQL statement.

提交回复
热议问题