Search Postgresql Archives

Re: Update concurrency

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



=?utf-8?Q?Sylvain_D=C3=A9ve?= <sylvain.deve@xxxxxxxxxxxxxx> writes:
>     # JSONB update for a single selected row and column.
>     # 'column' and 'select_row' are determined with the parameters 'data' and 'path'.
>     command = (
>         f"""UPDATE MY_TABLE SET """
>         f"""{column} = jsonb_merge({column}, %s) """
>         f"""WHERE {select_row};"""
>     )

> When called twice in a row, this call leads to the error (at "cur.execute"):
>     psycopg2.errors.InternalError_: tuple concurrently updated

That error should be pretty hard to reach from user code, and certainly
two successive UPDATEs ought not have anything to do with it.  I think
there is something you're not telling us about the context.  Does this
table have any triggers, weird constraints, or the like?  What is the
actual WHERE clause (ie, I wonder if you have simplified away some
relevant query detail)?  What PG version is this exactly?

			regards, tom lane






[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux