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 1sog1j-00CyLO-Md for pgsql-bugs@arkaria.postgresql.org; Thu, 12 Sep 2024 09:22:12 +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 1sog1j-002Z5N-Ck for pgsql-bugs@arkaria.postgresql.org; Thu, 12 Sep 2024 09:22:11 +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 1sofBJ-001JW3-Ey for pgsql-bugs@lists.postgresql.org; Thu, 12 Sep 2024 08:28:01 +0000 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sofBE-000lly-UM for pgsql-bugs@lists.postgresql.org; Thu, 12 Sep 2024 08:28:00 +0000 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-42cae6bb895so6117755e9.1 for ; Thu, 12 Sep 2024 01:27:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=deepbluecap-com.20230601.gappssmtp.com; s=20230601; t=1726129673; x=1726734473; darn=lists.postgresql.org; h=content-transfer-encoding:subject:from:to:content-language :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=9JrUzjpW/pFSEztKKnKkUa5BOVhI84Ok/sBGGODlxF0=; b=h26UfFNt+XWgVAexNBYLVPqxq53PQriptSZRsspk4HJDPTGvkm27I+EfmnOmgg2AOg RMbhdjvBW7/ZHs3754ziWKfZQUjt4WcQrJ0otTfFtGCsThMXa9IsM+EqAYs7zvS9rjDk /gz+bRWW549pyAa18eUAAQqsB3jOCtRc7gdKGj7NcBefzvLFsV4EHmmRizrcKdQsrLKo n/b5pVgL3rQhk+4I1UliHWX0TE0e4Zwx3p+o66SkIfKisqz+/9T9f+C38TmdiV8dalxl XoQ4yTR3Qx8w+wlgItaR+gWuaqpuXKgzrXPtztCk2gFPHYdYMN7udgcm3jta0ekwn43E udxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726129673; x=1726734473; h=content-transfer-encoding:subject:from:to:content-language :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=9JrUzjpW/pFSEztKKnKkUa5BOVhI84Ok/sBGGODlxF0=; b=DuWPaflBOvJpFu5vLisxDkzflIgNci2TqoX6hx4P1KcXy8alHc2OGoZrvmh6TjsPEx L2HPUa0qb62PNXBCJp3+5++29LHs52NsGlkplO9XwGJgmFC8BU/7j4VX5fn2CoznAh/W JWUttl09yipZz0hNt3nN9csuyOegY77lbiHq4vJtXpw+TTMmQx+PB4aJKVVfX3GrVB7v qgTIGxE02Vaxja5mh9z3wcww2pgjLNMUmYXv1VGGBpaQT1N5Y1/2r+jquHfxTTFDWX/9 PqL7Nw9+frpa+RVPr0e/oqH1PiuAlfntj/umaXR7jhrFTWBLeVGMLydPtWByC1HQ4ipy 6RHw== X-Gm-Message-State: AOJu0YzEA+apARsO8F21m5WXIW6Ihhc2ylAvPUa+0k0Js8htf+Yrk4HO /6/iljfR/xPGlcDQl8v8frTy0LjDxx4pukPAvJ2MJ7Xe4POYoNJY+Fh2TZbG8tivA4XR3lHrBai VzLJpHIYRWeA6ww3edw2STYMNg/Oo7kNmNtb3YwNMTu+cxd1Q1MmsDPy97SOeX8uonr0Hw7hFye yqIDIZBJZu9wZjiyRGdgNEO8CB1RtqIzZoVHgH/OsYUUF0UirD2LP+VUvXdFN8 X-Google-Smtp-Source: AGHT+IGRaeNEjg7Y5BD7vc7uhK2VJ0o3tcsg2X/kyJNcuUIYqYrI7wJjaMH3BdIB1os+tt64ZOgFEQ== X-Received: by 2002:a05:600c:45ce:b0:428:18d9:9963 with SMTP id 5b1f17b1804b1-42cdb586d9fmr16162825e9.22.1726129673059; Thu, 12 Sep 2024 01:27:53 -0700 (PDT) Received: from ?IPV6:2a01:e0a:255:1000:d668:3179:8802:3a0c? ([2a01:e0a:255:1000:d668:3179:8802:3a0c]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42caeb21a5csm165799205e9.6.2024.09.12.01.27.52 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 12 Sep 2024 01:27:52 -0700 (PDT) Message-ID: Date: Thu, 12 Sep 2024 10:27:52 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: pgsql-bugs@lists.postgresql.org From: Duncan Sands Subject: pg_restore with --disable-triggers discards ENABLE ALWAYS Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is with postgresql version 16.4. You can reproduce as follows: CREATE TABLE test_table(x int); CREATE FUNCTION test_function() RETURNS trigger AS $$ BEGIN RETURN NULL; END; $$ LANGUAGE plpgsql; CREATE TRIGGER test_trigger AFTER UPDATE ON test_table FOR EACH ROW EXECUTE FUNCTION test_function(); ALTER TABLE test_table ENABLE ALWAYS TRIGGER test_trigger; Checking the table: duncan=> \d test_table Table "public.test_table" Column | Type | Collation | Nullable | Default --------+---------+-----------+----------+--------- x | integer | | | Triggers firing always: test_trigger AFTER UPDATE ON test_table FOR EACH ROW EXECUTE FUNCTION test_function() ^ Observe "Triggers firing always". Now for the dump + restore: pg_dump -f dump.custom -Fc --table test_table pg_restore --data-only --disable-triggers --dbname duncan dump.custom Checking the table: duncan=> \d test_table Table "public.test_table" Column | Type | Collation | Nullable | Default --------+---------+-----------+----------+--------- x | integer | | | Triggers: test_trigger AFTER UPDATE ON test_table FOR EACH ROW EXECUTE FUNCTION test_function() ^ Observe that "Triggers firing always" has disappeared. Best wishes, Duncan.