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 1jsMHs-0004Mq-Gy for pgsql-general@arkaria.postgresql.org; Mon, 06 Jul 2020 08:15:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jsMHr-0004tW-Aw for pgsql-general@arkaria.postgresql.org; Mon, 06 Jul 2020 08:15:39 +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 1jsMHr-0004tM-37 for pgsql-general@lists.postgresql.org; Mon, 06 Jul 2020 08:15:39 +0000 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jsMHk-0003T6-Cs for pgsql-general@lists.postgresql.org; Mon, 06 Jul 2020 08:15:37 +0000 Received: by mail-wr1-x442.google.com with SMTP id z2so17523364wrp.2 for ; Mon, 06 Jul 2020 01:15:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=jsJAxuzN4doqd9b47LzMtluINrm9Am7wGSFnZ09RBVY=; b=dEg4utdpaNzosgIuOK+lzjS2G4Y4113dw9r5IoqDoZWvV8eIoat+xtVTbebovL52rf 0X18i6qYRepa/Rgr3xA3nEAYoQ0EqtrRaPXj1voeo/dZ0WJvS2Q6OyCuwFUrImq4C59F UhYyuSBi+8SeISlUEhQI9o/Jq9TCDkKct1bVkQ++idiiNuGEsmtgdhacurqJ3GIXoJ7F 7IfQ+gOLp0DhV3LzAo7uZza/sabPgquMMAf3mR5WJ2kF7qmJ9h3xB7Rv/pWT0nt/mbyo LX8x2csGjzHw/YKh92YD1ANJHHwmD3o8WVQIk8v5Swp304PU1tVXSDTRNw5TAqCIL+eC nZZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=jsJAxuzN4doqd9b47LzMtluINrm9Am7wGSFnZ09RBVY=; b=jFkuGweA+IRLpScP9lpeyXrnDCTQ/W4JcStpWBiqVdfI6GsIhKkPrPNi7QayO0KmZQ 1GxTgPHyO8xsk9YVHkLBaQ36XUK4rswKqIy5FSkMMa7DFiCqnuRPn0ExeqgopJxJk5Yn ugDjulclX0AH3wpTh79CNz3kbLArsOfxUfUOS4LyMeCHZCMYLpI1WlSGlHrXD5t6pkO2 tiaM7sD4ereWocERCkAvHSqGe/HWXQp+Ninb+n84w6Mh455oAq8TmRS0HHWs3Fdc+laQ oUlyl8VTMJWiXr3RUI3zWzZyxzcu2NL0Xhz5ll9EVlysQXqXZPvzzizfN/gagckTU5OB 6UtA== X-Gm-Message-State: AOAM532pW7Wc23NPiYTozuhzD2JB/27YyvzQ1CRhELjQwpWUnOtZ1PYP WPVVr5rOF0IAfY0/o3g53dfy6Q== X-Google-Smtp-Source: ABdhPJwIKw1xzrSK26mxNJS3qJSyTTukVfq4J5QeWCvq9i48YUiIn3fLbPoCReNPEfbbLHlyHo7GOQ== X-Received: by 2002:adf:f8cb:: with SMTP id f11mr50068147wrq.358.1594023330608; Mon, 06 Jul 2020 01:15:30 -0700 (PDT) Received: from localhost.localdomain ([212.186.219.234]) by smtp.gmail.com with ESMTPSA id g82sm20637756wma.37.2020.07.06.01.15.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jul 2020 01:15:29 -0700 (PDT) Message-ID: Subject: Re: survey: psql syntax errors abort my transactions From: Laurenz Albe To: Ron , pgsql-general@lists.postgresql.org Date: Mon, 06 Jul 2020 10:15:29 +0200 In-Reply-To: References: <658a910b8a785a859f651102798ead5c851d8034.camel@cybertec.at> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.32.5 (3.32.5-1.fc30) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Fri, 2020-07-03 at 12:46 -0500, Ron wrote: > > This is my favorite example why I like the way PostgreSQL does things: > > > > /* poor man's VACUUM (FULL) */ > > BEGIN; > > CREATTE TABLE t2 AS SELECT * FROM t1; > > DROP TABLE t1; > > ALTER TABLE t2 RENAME TO t1; > > COMMIT; > > How so, since it does not carry over indexes, foreign keys, triggers, > partition references, etc? It is an example of what a transaction could look like that would suffer from statement-level rollback. I am not claimimg that that code as such is very useful. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com