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.96) (envelope-from ) id 1vgh8U-000J8T-16 for pgsql-general@arkaria.postgresql.org; Fri, 16 Jan 2026 10:32:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vgh8T-002jDb-10 for pgsql-general@arkaria.postgresql.org; Fri, 16 Jan 2026 10:32:57 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vgh8S-002jDS-38 for pgsql-general@lists.postgresql.org; Fri, 16 Jan 2026 10:32:57 +0000 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vgh8R-000ndy-1O for pgsql-general@lists.postgresql.org; Fri, 16 Jan 2026 10:32:57 +0000 Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-2a07fac8aa1so13301175ad.1 for ; Fri, 16 Jan 2026 02:32:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1768559573; cv=none; d=google.com; s=arc-20240605; b=RmRC9Gm524baXFbJlpGynWYMLoExnLsvWC3gyQcDlT1HnNr+dfq4hT6qy8Q1N50N/P StqerrxAnUvRXeyAz6teF92t8jtLdmfoW35WAXZanZAofZnWG1+bs9L1bNwC527Qqj+j M9yZD45B9NtP1Qo4JN+wMRDbHe9g4omU0ftPJsG0mW7g/9izcXwj9qhZ3rZjqcWTW4b1 Z/4du6aGOYprHTTyAyyK1r7lLXJ8cH+M73D02mtRcPKQNAz10g9cJxFQddU9GWV8tJur Wu49lfUuGCdv6+W8YkGN2LVfkoWviII88tZYf6lbEeXAGWChTSic9Ib80cDnfekZf69v Fvtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=7pxZU6tngMMeNOfQwZ5UihrEVsCMV0VT7gOEQoDXez4=; fh=TyfF928R0kWQkVYCfOLuMPEh1+N9CbjsgKsB+SIUPKs=; b=aO0L1wLLEnvW0v/m/A9fz2JSCDnLWkZdtrTy8KgNipcXwMcMzVneO2wJkCVZuo9tvp n6Xd9fAqR56cOj6BZMKeVBb8v8fTsY1FUndRE8hi1GWrpCat5cQD+H0mnEXEPvxyzFtE BS6svyVbC0RPXhAN5AB2Fy4OpftUNBhMMEWqJWsAw95ij//ImYdyHD7edzDLE1Gpoi0D 9aMIEB5o07xHWoxw/W0Zf20nLONP+AANDOOy/ffdawGUzri3CXFaeOaKe/Cv6lW5KjxJ OCdk8B718dikBPXIlnJFS/AGx87xKgqM7XzvfMLADcXvk5j3RjwNQhAAzw5Mot0whs9N UPSg==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1768559573; x=1769164373; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=7pxZU6tngMMeNOfQwZ5UihrEVsCMV0VT7gOEQoDXez4=; b=faMadt5VEljVOKVd3X0+AnWy8//BpXPYpSnYea3kx2vEVJPoHOruQJYLY9qWqThGO0 FRUzOH5mwO12BF/4/vJFqZuMTZ2wknmpvem8t56oyDsw0pm58z0LiGFoGmbNud5I59/9 F8pmTKq+3ZQ3Fp8joSzwdMmDarfoCTB34JAO7dTY1e5UdLJEm5DVPObDSeI2QHoCu+Ms XUbFoLrbUYwbkBYLETIDSbgU/fr4lLqI6hqHschAOoTSDoLbZPzdfMd/qBSch4BV0B77 Mg1dFobJuzAH1vD7X7S+pXFuPwr9rleyR64zZBA/6TlpBoiCg0KwbG89RnfsPB3PZpFh 868w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768559573; x=1769164373; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=7pxZU6tngMMeNOfQwZ5UihrEVsCMV0VT7gOEQoDXez4=; b=ePhFXsJgvLVioKWduCPWbQ4fjL4IUi/lD/QG0vTeKKf0j5k1EK/L0oVXLlLc2tLiA+ +t1Jt6qEopEJUSvOhqxlTBizB8OZACJxwUxhPj+Uf5uCo/D6ncMB4rFqrK99vRevQtAu eT9GQFeTzWrNCbX61hYtQFuCiJWVjEOY0cAMbO7SlDqi0pmlVfpwRAXvFlki7wiV/gMj /F+R9MwlqxqgOxeGdv+Ivx60E1ZO3EGs3hj3FJgWuXoh45RfkKb+NH5HVrjw7QBfuK3S IgfZ/u07YLLkUosIKmd8qS2+brOC6tUbfqYDfbN6YFHi+TotYbaiuH+SRXQinn55a0FS AKCg== X-Gm-Message-State: AOJu0YxIEryog66tPAVKXORQdLCzJXm2KeKm88IyvQhJzvupbRRV+C0t kUkA/aCGoVC+rsFcNNo7bdET2bd+rMdZd37w0+1HT0GHFo/scF/MJuQGbW8PcMbsZ8yhFlAqpyY 3nfE5TRawne7LIXVJiVa5aWOSfFqBLUw= X-Gm-Gg: AY/fxX5bfhjA2ynUCvF/8sn+eiAepe3ncuzq2LF1fZSL+MhX6Ff2lk8ZdoOgY2UPwu+ v5CXu/zcvN1tz6HhHIoJlYSNFB8iqbuxDyNM7RqWlHNjJ6kEkGhHujDo4CUIbDI4HSK8fafYCrR LN/gip0c+hx1i7M0w+6OdNjDaWFqyLTS4p6hQwH6git7/kcrXN15PyaEjFeVMNf8gw2UavytiIK z1gD3N88rvBSzdcWvoG04tgHfvbi/OTG8/ugqeFjgr+Of2U43OcP1TNHuKyU4TLqDAzzjznTg== X-Received: by 2002:a17:90b:224f:b0:343:684c:f8a0 with SMTP id 98e67ed59e1d1-35272f6cf26mr2199612a91.23.1768559573172; Fri, 16 Jan 2026 02:32:53 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Dominique Devienne Date: Fri, 16 Jan 2026 11:32:41 +0100 X-Gm-Features: AZwV_QgyFTBDSbHXJqcJ5Wu8e0Wdkt2hrC05KnrCMA8inaB-iV3alO02a-bJoG0 Message-ID: Subject: Re: Why does TRUNCATE require a special privilege? To: Marcelo Fernandes Cc: pgsql-general@lists.postgresql.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, Jan 16, 2026 at 10:13=E2=80=AFAM Marcelo Fernandes wrote: > From the documentation: > > TRUNCATE quickly removes all rows from a set of tables. It has the same > > effect as an unqualified DELETE on each table, but since it does not ac= tually > > scan the tables it is faster. > > (...) > > You must have the TRUNCATE privilege on a table to truncate it. > > Granted that TRUNCATE and DELETE are different operations under the hood,= but > why would the TRUNCATE operation require its own specific privilege rathe= r than > say, use the same privilege as the DELETE operation? It's kinda obvious, when you read the notes. 1) Not MVCC-safe. 2) Do not fire TRIGGERs, thus breaking data-integrity 3) "Viral" in the presence of FKs, i.e. related tables must also be TRUNCAT= Ed Just these 3 are HUGE departures from a DELETE. --DD