Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sEaX3-002LH4-Mn for pgsql-hackers@arkaria.postgresql.org; Tue, 04 Jun 2024 20:13:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sEaX2-002MIm-Kb for pgsql-hackers@arkaria.postgresql.org; Tue, 04 Jun 2024 20:13:20 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sEaX2-002MIe-AT for pgsql-hackers@lists.postgresql.org; Tue, 04 Jun 2024 20:13:20 +0000 Received: from mail-io1-xd2c.google.com ([2607:f8b0:4864:20::d2c]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sEaWz-003TEW-P7 for pgsql-hackers@lists.postgresql.org; Tue, 04 Jun 2024 20:13:19 +0000 Received: by mail-io1-xd2c.google.com with SMTP id ca18e2360f4ac-7eb3a45674cso18064539f.2 for ; Tue, 04 Jun 2024 13:13:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717531995; x=1718136795; darn=lists.postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=ve7njgDzlAUCOGrAxghwq/GXFirUWRi4vtrZpN7elp4=; b=ZnPyVg4shDya7mOT3X7l9hcZ76etb0QNHIL26l2MHEybSPmS4dsDbBPNAXXO5owyzR 1z5TTu+9JQL68ok2uqwNqEeMOpqAUBEnF0ki74FvCj0CKfcujfdbK8EPcJZOUkIeD1oV kssV21QkCY1s2JwuRynYBu2yIvIlGMXCvl+I+pSmwRUxBzKzjPgaqmX8ciA3+InVvWnM obQ4AM/Jnq8d7Sx6NV0VKOrJpl/G7qB1RIy5WyNAa4g9PC1CFfXTd62H6CVaCNC8BXyn hcJ8lLqHuH/88gzTi9KjYxKrUERmYd+fpjoGrxs9EAI1XJ2OnCoDDI5T06lxE8hNyPFy 5m1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717531995; x=1718136795; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ve7njgDzlAUCOGrAxghwq/GXFirUWRi4vtrZpN7elp4=; b=AMfAc0lbOUmvueiCIn8+F8AnUPcFlZvs/AjXjrIlDWzGYn4ABPDshi1t8S9abhluDF CSKJ/jMBSfNPHNJ8Ib4Gl9toKlxq9Hqhp1a8PjP1zUYg7yTh6HOv8zt2fH+BU+OhNzRy l0VahEfwHyex/vupC0SExFGmkHhU65Uq2QRyCwdJV0f7iMM6O65epD0UBaP/l3hHpN48 xpA2uXP19yCbsFA9BmJvo319peLbEam5fNTkZ4uSn0BuPSgcHknaM2YA5cMroy8KsFWc BE41E9IrWCPNW5foJV6GJUgfFLM/0YSmVJGgq79bn0jHecftmNPe2Uclx9YOx7wBAu7x Yxjw== X-Gm-Message-State: AOJu0YyIQ2suquugWC2T8KZ5I2mjz/DTCrKol2/VLHGV/yjjxMnhwyAS 02qHkb0Wsd5jehik+q9Ht/vkAG+Ot/jOe7xCq+l0h/Erx+5HpmGi10iTpQ== X-Google-Smtp-Source: AGHT+IF9ToaPrwqyW4+uu0EbpjBXglWKfMtDOKUWkhdvrHInDVY10mLwmHDYuhI0cPRJZ/4xGlLenQ== X-Received: by 2002:a05:6602:4b86:b0:7e1:7cb1:5f23 with SMTP id ca18e2360f4ac-7eb3cab6d98mr39306839f.13.1717531994687; Tue, 04 Jun 2024 13:13:14 -0700 (PDT) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id ca18e2360f4ac-7eafe58d6d0sm268693639f.9.2024.06.04.13.13.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 13:13:14 -0700 (PDT) Date: Tue, 4 Jun 2024 15:13:12 -0500 From: Nathan Bossart To: Tom Lane Cc: pgsql-hackers@lists.postgresql.org, Peter Eisentraut , Victor Yegorov , Pierre Forstmann Subject: Re: Unexpected results from CALL and AUTOCOMMIT=off Message-ID: References: <90052.1717442890@sss.pgh.pa.us> <378291.1717464748@sss.pgh.pa.us> <538151.1717525723@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <538151.1717525723@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Jun 04, 2024 at 02:28:43PM -0400, Tom Lane wrote: > Actually, after poking around some more I found that there *is* a way > to deal with this within spi.c: we can make _SPI_execute_plan ignore > options->allow_nonatomic unless the SPI_OPT_NONATOMIC flag was given > when connecting. > > I like this better than my first solution because (a) it seems to > make the allow_nonatomic flag behave in a more intuitive way; > (b) spi.c gates some other behaviors on SPI_OPT_NONATOMIC, so that > gating this one too seems more consistent, and (c) this way, we fix > not only plpgsql but anything that has copied its coding pattern. +1 > Hence, new patch attached, now with docs and tests. Barring > objections I'll push this one. Should we expand the documentation for SPI_connect_ext() to note that SPI_execute_extended()/SPI_execute_plan_extended() depend on the flag? -- nathan