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 1neFCP-0003vj-LN for pgsql-admin@arkaria.postgresql.org; Tue, 12 Apr 2022 12:00:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1neFCO-0002mS-H6 for pgsql-admin@arkaria.postgresql.org; Tue, 12 Apr 2022 12:00:44 +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 1neFCO-0002lB-4i for pgsql-admin@lists.postgresql.org; Tue, 12 Apr 2022 12:00:44 +0000 Received: from mail-qt1-x829.google.com ([2607:f8b0:4864:20::829]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1neFCH-0004Vp-JW for pgsql-admin@lists.postgresql.org; Tue, 12 Apr 2022 12:00:43 +0000 Received: by mail-qt1-x829.google.com with SMTP id s6so4331167qta.1 for ; Tue, 12 Apr 2022 05:00:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :references:from:in-reply-to; bh=MXqiVX/WOkFUzZnDfQutymn2UL0pfgIHO9beSk7rKB8=; b=SUckzWniq0xp2R4r5rKGXyCxnUq52+CIbACoSlNEyYrQ2ciFBFPKtt+jZinSLgGnzB Z2iiaDJoDFjokRk0Q5M00AoJ8BmVCWq0VAl8zB7SgAI53EwYpcnRoAyfXUOo49Ha91zc uRZJDL2lfLWoMjSOwxSixq6NKqvrP+lH8reIvD6b1GanYnePCwJgaIQ7DL6lw2UdofPl 7dNRheH4aGSBfz6vMihA8gOkupxOBq2T3Qc80I79vMt3HQUthVSjPkcVCVzKQhG+qArL x7nvtiwn2f+VpKki+MR7V2qowMp7GIaOhsW5XG/snozpAPPkq4MaJ6Y6jI6VLrje+1CF U6lw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to; bh=MXqiVX/WOkFUzZnDfQutymn2UL0pfgIHO9beSk7rKB8=; b=BFkZTF4eSNBg33IH5zgKJK4KNly7FNfDAaA66OojzsD0IlZpzFw9GrScoLezmWZHGH PXqnsewG3Dq7j0kIhijZQzF0fgErHUxYt9+GlfDwjFDdhnYxVKkPD0sn1zuV2VCrx0Yn ZIXADVvFS3VBtJZ3tuKm6dgDYuCnZSRZkI7DS8mVZEm35LWC5hEvtumboqwbao1j0XSf evcrYI+/gzdHltjtzeeg38tuDepMR4RGB9Wu2tl3raGQCictSdbV1Y66ngzw76QVGocN Tgcbn7jDjfSQhqLSFOVyecOCkzZYcnkwN4DFKIW23hzzgN7sIjKRC5Wta2M5/N7DR8H/ yC8A== X-Gm-Message-State: AOAM533DQrZtH5YA/YdE5n56o1JBSKsgXMRcIfMBfxQRWt90P5Zu6YK6 bcRAZdKeEuj0Y7jX6eys6f7HGf57Yk27wdHr X-Google-Smtp-Source: ABdhPJyvgICbk0VkyXIk0YY4hibwYzHTVDqmBEjMVcRuDqtyaemEZsp0bD6wD8chYn/irxh57mNq5A== X-Received: by 2002:a05:622a:6082:b0:2f1:1f9c:251e with SMTP id hf2-20020a05622a608200b002f11f9c251emr531937qtb.230.1649764836089; Tue, 12 Apr 2022 05:00:36 -0700 (PDT) Received: from [192.168.2.100] (pool-72-79-19-93.nwrknj.east.verizon.net. [72.79.19.93]) by smtp.gmail.com with ESMTPSA id i62-20020a37b841000000b0069c10d27571sm4569611qkf.70.2022.04.12.05.00.35 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 12 Apr 2022 05:00:35 -0700 (PDT) Content-Type: multipart/alternative; boundary="------------YTDUSUI9Ux0tnXll07TZ4ECw" Message-ID: <37b5b251-83f8-56bc-579d-882daaa4fc47@gmail.com> Date: Tue, 12 Apr 2022 08:00:35 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: set autocommit only for select statements Content-Language: en-US To: pgsql-admin@lists.postgresql.org References: <548f2ed6-3209-705d-09e2-a5afbc6fb71c@quadratum-braccas.com> <6bfd5d91-bb06-1b56-f4f8-cc8f90307a35@jakobs.com> From: Mladen Gogala In-Reply-To: <6bfd5d91-bb06-1b56-f4f8-cc8f90307a35@jakobs.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------YTDUSUI9Ux0tnXll07TZ4ECw Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 4/12/22 02:31, Holger Jakobs wrote: > What you write about psql sending a COMMIT statement after each > statement is wrong. It may be true for other database systems. > > PostgreSQL as a server commits each statement automatically unless the > client has started a transaction with BEGIN or START TRANSACTION > statements. > > This can be proved easily by not using psql as a client, but some > programming language. > > Regards, If what you are saying was true, then autocommit would be a database mode, not a tool mode. It isn't a database mode. Q.E.D. -- Mladen Gogala Database Consultant Tel: (347) 321-1217 https://dbwhisperer.wordpress.com --------------YTDUSUI9Ux0tnXll07TZ4ECw Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit
On 4/12/22 02:31, Holger Jakobs wrote:
What you write about psql sending a COMMIT statement after each statement is wrong. It may be true for other database systems.

PostgreSQL as a server commits each statement automatically unless the client has started a transaction with BEGIN or START TRANSACTION statements.

This can be proved easily by not using psql as a client, but some programming language.

Regards,

If what you are saying was true, then autocommit would be a database mode, not a tool mode. It isn't a database mode. Q.E.D.

-- 
Mladen Gogala
Database Consultant
Tel: (347) 321-1217
https://dbwhisperer.wordpress.com
--------------YTDUSUI9Ux0tnXll07TZ4ECw--