0

I have a multi-lingual Django/Postgres-based app that fails on the following input (sanitized):

STATEMENT:  INSERT INTO "main_model" ("a_id", "b", "c", "d", "text", "f", "g", "h")
  VALUES (1, 2, 'c', 'd', '...nahlá<U+009A>ení ... nahla<U+009A>ování...', 'f', 'g', 'h')
  RETURNING "main_model"."id"
ERROR:  current transaction is aborted, commands ignored until end of transaction block

The text strings are in unicode, and it appears postgres is chocking on it. This is one example, but this is happening on several other languages as well.

Is there a better way to understand what the exact error on this statement is?

Is there any sanitation I need to do on the unicode strings before throwing them on the DB?

4

1 回答 1

0

I stumbled onto https://stackoverflow.com/a/10437521/24545

The lesson learned from this issue is to ensure there are no errors that are caught and not handled.

In my case I had a try/except block that was hiding a real error, and the next time it came up was a transaction error in postgres.

于 2012-06-12T14:46:14.173 回答