Re: Error with DefineSavepoint:Unexpected state STARTED

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Computer Study <computerstudy2010(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL mailing lists <pgsql-general(at)postgresql(dot)org>
Subject: Re: Error with DefineSavepoint:Unexpected state STARTED
Date: 2017-06-20 04:48:57
Message-ID: CAB7nPqSsPnF3Thfqj8C_L6=k48WUh-ScOV=wVL4cgXV2AstT8A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Jun 20, 2017 at 11:12 AM, Computer Study
<computerstudy2010(at)gmail(dot)com> wrote:
> The UI application is to add/remove some permissions through a listbox for
> a certain user. For any add/remove, it will first delete all records for
> this certain user in the table, then insert the values chose from UI.
>
> In my code snippet, it first execute the DELETE, then execute multiple
> INSERT to insert selected options into the table. After all done, commit.
>
> The server is in remote and I don't have detailed logs at this moment. Will
> try to ask for that.
>
> My question: for that error 'DefineSavepoint: unexpected state STARTED',
> not quite sure happens in which step? In the middle of DELETE or INSERT?

This error has been around for a while, and funnily you are the second
reporter of this issue within a couple of weeks:
https://www.postgresql.org/message-id/0A3221C70F24FB45833433255569204D1F6BE40D@G01JPEXMBYT05
I have been thinking a bit about how to fix that, and wondered about
using a new transaction status to track that, but that finished by
being rather intrusive..
--
Michael

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Osahon Oduware 2017-06-20 11:43:24 Table Updatable By Trigger Only
Previous Message Andreas Kretschmer 2017-06-20 04:30:12 Re: Streaming replication bandwith per table