Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kOKC6-0005Cq-Az for pgsql-odbc@arkaria.postgresql.org; Fri, 02 Oct 2020 12:29:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kOKC4-0004vI-Fw for pgsql-odbc@arkaria.postgresql.org; Fri, 02 Oct 2020 12:29:48 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kOKC4-0004vB-7T for pgsql-odbc@lists.postgresql.org; Fri, 02 Oct 2020 12:29:48 +0000 Received: from mail-lj1-x241.google.com ([2a00:1450:4864:20::241]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kOKC0-0008R8-PO for pgsql-odbc@lists.postgresql.org; Fri, 02 Oct 2020 12:29:47 +0000 Received: by mail-lj1-x241.google.com with SMTP id v23so1046547ljd.1 for ; Fri, 02 Oct 2020 05:29:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:mime-version:subject:message-id:date:to; bh=PHle8z/yxJeYIS91+zYwZ26SB8qQyaPXG0Tk5qexuy4=; b=h979KWOAcan6P0aDwnSuIq/vEbOEFxc0f1k93rnjBsihvMg7imIic01F3Wz05MeGJq 2suLmezzAYjpxlbuXMTnpdpTVyoz7RmLpQ202n+d9u83N7G65b/rHf4Fm/NCDdVrgh2J 7V4iPKlWWc7/kMy+QsATXcbsgRNeLe/DNX2/qlb8p/6hp4srpHkMHstkKiC//eZWbOkI hRv7Q/ymvzGXc3oxYAWrVCX/f1Bvf441g9PnfwhPhgJS3vLb91wanjwv+L5l79EGOj+d qXmmnY2shOG3fMDAxBpkcjkajsZwEhyEI98beyGLvghDVawAR0LYJO9OKts0UGNnVLst CElQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:mime-version:subject:message-id:date:to; bh=PHle8z/yxJeYIS91+zYwZ26SB8qQyaPXG0Tk5qexuy4=; b=RCXTID9norL9hVpu+Jw+CaF7jmOdfu0djPG3CCFjVl7h6r0bvw2ukjiqp6qev4od65 sDyr6lfgK9/lXc4NzEiNL6JLz4TxHqB+GyKrRSYAyDPbH+iBCEtXn4R/AzKEJiMazdyi PPS4Zuyjufqoqe9MMJ2d9kmWF0gZrKQ6t8uTxUAgkpaN6PPZtvI4xy6fkZnczfqBsSAV RRFLpYGeFr+3+5IYxI2zvz2qHH90ED18/NoT7CEBZb9pvbtLYbfs7wOC3DYWyaYYH62X wvArskI0M0zUr1W80emEW+LDx2sqx49Qk5dtNiwC17xbT17/QSxo2Z/Wbvvy6vk51lgr zw6g== X-Gm-Message-State: AOAM532GE1o0o+GfHRIUfJNsttGHW3DG5AZV+hgH28QdKNo8OrkfEW0/ uMyEj6XiwR5t3Gly7gPHlLAiMkRKrZ4= X-Google-Smtp-Source: ABdhPJx+K8MoDNWee0kooIypDRh55esed4V6U337gZfFlj9v8R/wC/j316S1rYNTJN6ZqAEPEVHcGQ== X-Received: by 2002:a2e:9815:: with SMTP id a21mr681947ljj.311.1601641782710; Fri, 02 Oct 2020 05:29:42 -0700 (PDT) Received: from minibagroff.cadabra ([31.134.191.117]) by smtp.gmail.com with ESMTPSA id a22sm271097lfb.89.2020.10.02.05.29.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 02 Oct 2020 05:29:42 -0700 (PDT) From: Daniil Megrabyan Content-Type: multipart/alternative; boundary="Apple-Mail=_977ECEC5-A025-4967-BD65-A66B02D24751" Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Subject: How to release savepoints properly? Message-Id: Date: Fri, 2 Oct 2020 15:29:40 +0300 To: pgsql-odbc@lists.postgresql.org X-Mailer: Apple Mail (2.3608.120.23.2.4) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --Apple-Mail=_977ECEC5-A025-4967-BD65-A66B02D24751 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Hello! (Preamble: AUTOCOMMIT is off) When I call SQLExecDirect(SELECT * FROM B...) in the pg_stat_activity I = see "idle in transaction" for query "RELEASE = _EXEC_SVP_0x10a0df600;SAVEPOINT _EXEC_SVP_0x10a0df600;SELECT * FROM B" = even after SQLFreeStmt(SQL_CLOSE + SQL_UNBIND + SQL_RESET_PARAMS).=20 I guess that first "RELEASE" in the generated query is needed to release = currently active savepoint which was executed under the hood (generated = in GenerateSvpCommand()) within previous SQLExecDirect(SELECT * FROM A) = - in other words we are renewing the savepoint every SQLExecDirect.=20 In my point of view RELEASE should also be called under the hood(in = PGAPI_FreeStmt()) on SQLStmtFree(SQL_CLOSE). Otherwise the last query = locks table B forever and I cannot modify table B from other = connections.=20 At the same time I completely understand there is already 12th release = and admit that I rather do not understand something and everything is by = design. Should I call just SQLEndTran(despite the fact that just SELECT was = executed and nothing really can be rolled back) in such case?=20 macos 10.15.7 psql-odbc 12.02.0000 unixodbc 2.3.9 Thank you!= --Apple-Mail=_977ECEC5-A025-4967-BD65-A66B02D24751 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii
Hello!

(Preamble: = AUTOCOMMIT is off)

When I call = SQLExecDirect(SELECT * FROM B...) in the pg_stat_activity I see "idle in = transaction" for query "RELEASE _EXEC_SVP_0x10a0df600;SAVEPOINT = _EXEC_SVP_0x10a0df600;SELECT * FROM B" even after SQLFreeStmt(SQL_CLOSE = + SQL_UNBIND + SQL_RESET_PARAMS). 

I guess that first "RELEASE" in the generated = query is needed to release currently active savepoint which was executed = under the hood (generated in GenerateSvpCommand()) within previous = SQLExecDirect(SELECT * FROM A) - in other words we are renewing the = savepoint every SQLExecDirect. 

In my point of view RELEASE should also be called = under the hood(in PGAPI_FreeStmt()) on SQLStmtFree(SQL_CLOSE). Otherwise = the last query locks table B forever and I cannot modify table B from = other connections. 

At the same = time I completely understand there is already 12th release and admit = that I rather do not understand something and everything is by = design.

Should I call just SQLEndTran(despite the fact that just SELECT was executed and nothing = really can be rolled back) in such case? 

macos 10.15.7
psql-odbc = 12.02.0000
unixodbc 2.3.9

Thank you!
= --Apple-Mail=_977ECEC5-A025-4967-BD65-A66B02D24751--