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 1m6Z73-0002Eb-Aw for pgsql-general@arkaria.postgresql.org; Thu, 22 Jul 2021 13:51: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 1m6Z71-0004wC-TO for pgsql-general@arkaria.postgresql.org; Thu, 22 Jul 2021 13:51:43 +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 1m6Z71-0004uJ-KL for pgsql-general@lists.postgresql.org; Thu, 22 Jul 2021 13:51:43 +0000 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1m6Z6u-0004Tc-PJ for pgsql-general@lists.postgresql.org; Thu, 22 Jul 2021 13:51:42 +0000 Received: by mail-wm1-x32c.google.com with SMTP id o30-20020a05600c511eb029022e0571d1a0so3002995wms.5 for ; Thu, 22 Jul 2021 06:51:36 -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=q7kOHG8WApnNfe5w7U54ddqTZZs7B6Zbog852gQgTtQ=; b=lJgRDizrPPstPc+BpPoumkQQR8NlWC7g/jZczai6WDXRM66I3seXxcYDl6OZDf/ksU 6fcm7fnRkcLhEh182Tt+1XzSbQ5aLWaP6YV2lsiFJuCw2gnzZ6kxD3NBEqZAm7qVYXdL GTywuC3PwQYF5lZHkDlP2YstQ0FtLSAy9IXDV4kjK4o4tTAuVDbo0kg/05u0CwM1DYpV 6Good1SQV4+zdp5ybKo4YSY6h1JRT7PZoaLTkTQ2MO6bwfNQPyNsCm4owbRURSGFLfv2 t9lv8QUXJJ2UYIUbx2LeAQbsS1oxuDDirmUoaQDHzVIzq0ZE0XJ2HuWCkvWtOrXXpzlN y3dg== 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=q7kOHG8WApnNfe5w7U54ddqTZZs7B6Zbog852gQgTtQ=; b=i1gsmqUqsK6aZTdS4oNZF5TbTaxoqDh71Yth5SA6kQ3xV0WPwG1Wt/acV0fDpNL5FD a3nAZuCJVw5pEascwk+AhHhXJX0YnRAWJWWFCi73FFo6yTV77HOnNnWbSbIcEJ8+1ijv aQ9i5l8I968LgF4xP/DPzXxVoyQBTqBVDL9D07IwNmg6ymWXjLitRcc5P/dexVDABKSv zchk0nsbYKSqrU26Cl5fhQfW5r/OJmLJ73ldnaDm9MS5+dnTesDds/rqOGQlsbx+27cb y4UHfqj29+OSegFBkndfRA0J2TREbkEO2iIyt9QRmNNBsyb/rZxRAJl/osGcNg2K1/Q6 VbHg== X-Gm-Message-State: AOAM531efttQPFd9APD5SasFB37648i3/gxykM/rySCIzEvMgwYJ6ID6 dLKIxzJdi4JtBAjHSbmn9YWfwA== X-Google-Smtp-Source: ABdhPJwtGYk6aJP5yoFQ0kpkDeV+WMajUFaHwKCz9mzC9cd3i0alz1yylGqJkVEmkmxha+YBtwtzEA== X-Received: by 2002:a1c:4c0a:: with SMTP id z10mr43595602wmf.24.1626961893511; Thu, 22 Jul 2021 06:51:33 -0700 (PDT) Received: from localhost.localdomain (217-149-170-241.nat.highway.telekom.at. [217.149.170.241]) by smtp.gmail.com with ESMTPSA id 6sm2685386wmi.3.2021.07.22.06.51.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Jul 2021 06:51:33 -0700 (PDT) Message-ID: <5ff10b4457613f0bbb768a883af40bdfdb8fe1cd.camel@cybertec.at> Subject: Re: Why does VACUUM FULL pg_class sometimes wait for ShareLock on another transaction after getting AccessExclusiveLock on pg_class? From: Laurenz Albe To: Marcin Barczynski , pgsql-general@lists.postgresql.org Date: Thu, 22 Jul 2021 15:51:32 +0200 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5 (3.36.5-2.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, 2021-07-22 at 12:55 +0200, Marcin Barczynski wrote: > There was a long-running transaction consisting of two queries: > > CREATE TEMPORARY TABLE abc AS SELECT * FROM def_view; > INSERT INTO xyz_table SELECT * FROM abc; > > When I ran VACUUM FULL pg_class, it waited for ShareLock on that transaction: There must have been something else using "pg_class", since the above won't take any permament locks on "pg_class", nor should it block VACUUM. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com