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 1qlPfA-002gG5-8J for pgsql-general@arkaria.postgresql.org; Wed, 27 Sep 2023 08:12:52 +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 1qlPf8-001YRi-Ul for pgsql-general@arkaria.postgresql.org; Wed, 27 Sep 2023 08:12:50 +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.94.2) (envelope-from ) id 1qlPf8-001YRU-I8 for pgsql-general@lists.postgresql.org; Wed, 27 Sep 2023 08:12:50 +0000 Received: from mail-lf1-x130.google.com ([2a00:1450:4864:20::130]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qlPf5-007r3r-Ue for pgsql-general@lists.postgresql.org; Wed, 27 Sep 2023 08:12:49 +0000 Received: by mail-lf1-x130.google.com with SMTP id 2adb3069b0e04-503065c4b25so16740581e87.1 for ; Wed, 27 Sep 2023 01:12:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20230601.gappssmtp.com; s=20230601; t=1695802367; x=1696407167; darn=lists.postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date :message-id:reply-to; bh=OjNAOhB+MU891K7B+EbNTYtvBAb3oqPP7v1Z8Odg4PM=; b=0d8w2WO8Vkz2jWlfyunq/T/S28K+Tx1D6mq2oVymgiFrktyGyiNPlshr9ljSrXyB2L jT6BfowP6f95VaWeh8xFEahmBPJJ2GB/usx6LHlOHL6JeEM2fak9ERQluJLs6FoLzAmK dRXnRV8SquZ8HF3J0C6WKZTCD0JVx22amC8+SeOdfquGr2ZThBQXTDMsO3lAXUejecEx y2vN4JuCZKq3GkNK+YyxoFw6xyC1zTPO6ivjD6bcf6SFf2hV/uwIYAMEsKY6y7oLjR2P gVpYOzhgFxTvV2PqE8rrYQZWdKqwHuMtm6DrZwgocKHTB3Xbz2L12pwSfD5nrDuZIIh9 WPlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695802367; x=1696407167; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=OjNAOhB+MU891K7B+EbNTYtvBAb3oqPP7v1Z8Odg4PM=; b=ka9jzA1BgPX+khzs40t5LViXqYl1v7RFlfYWOrFyUft29Z9h0M/IIf97A5ni8Rza7S xW8X9gxqpZEKg+PtJ8el3bJ8vVsl7GBRgucYMyV5vWBd013i0s+Ss9JhuGr110LXSuNU mS/4Uxna8xCCiDr28MuJLkiWVlHO8b8xpCAhA3RHhUr/jLGLCT95MuRx+EGxAZRc0pzt OCB3wgmHVRc+iXiDbTFQ/DXlj53LTbBQDh/WQSpeggtK/6lfdvxrEOttRcawsoWcOFcR 3hymbYUpRfESiargTFcEYXMtMAOjkxqniHkBwQd3YZ4qz4ijRCCrA1oqDGNRDH4u2L+9 ytlQ== X-Gm-Message-State: AOJu0YwyLKs551l9OXkoAWaYc1PiEBwK9i52/TWNh9n+vnHFqOBaDM/N x/PZ8a+fAHZoljDzio8M7PcNFWK/hV5U+H2vAFg= X-Google-Smtp-Source: AGHT+IEiOe7dEc1JAQ+ygdq+QS61fSi154STaROd7oojtwnKRmwjwHm3j4UJeqC4jJLeRvO08yP/0w== X-Received: by 2002:a19:6713:0:b0:4fe:94a1:da84 with SMTP id b19-20020a196713000000b004fe94a1da84mr1104607lfc.5.1695802366674; Wed, 27 Sep 2023 01:12:46 -0700 (PDT) Received: from localhost.localdomain (178-190-177-111.adsl.highway.telekom.at. [178.190.177.111]) by smtp.gmail.com with ESMTPSA id s10-20020a05600c044a00b00405623e0186sm11019782wmb.26.2023.09.27.01.12.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Sep 2023 01:12:46 -0700 (PDT) Message-ID: <605173d4ea36cbd20d96c8f4695d00a558b4a543.camel@cybertec.at> Subject: Re: log_statement vs log_min_duration_statement From: Laurenz Albe To: Atul Kumar , pgsql-general Date: Wed, 27 Sep 2023 10:12:45 +0200 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, 2023-09-27 at 00:01 +0530, Atul Kumar wrote: > my postgres version is 12 and running on centos 7 >=20 > my log_statement is set to "DDL". >=20 > and log_min_duration_statement is set to "1ms" >=20 > so technically it should log "ONLY DDLs" that take more than 1ms. >=20 > but to my surprise, postgres is logging DML as well which is taking more = than 1ms. log_statement =3D 'ddl' will log all DDL. log_min_duration_statement =3D 1 will log all statements that take longer than a millisecond. These settings are independent from each other. So PostgreSQL logs all statements that are DDL *OR* that take longer than a millisecond, rather than all statements that are DDL *AND* take longer than a millisecond, as you seem to expect. Yours, Laurenz Albe