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 1ltu2l-0000P5-K6 for pgsql-general@arkaria.postgresql.org; Thu, 17 Jun 2021 15:34:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ltu2k-0008Go-Ja for pgsql-general@arkaria.postgresql.org; Thu, 17 Jun 2021 15:34:58 +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 1ltu2k-0008Dq-8K for pgsql-general@lists.postgresql.org; Thu, 17 Jun 2021 15:34:58 +0000 Received: from mail-pg1-x52c.google.com ([2607:f8b0:4864:20::52c]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ltu2h-0004E1-Uj for pgsql-general@lists.postgresql.org; Thu, 17 Jun 2021 15:34:57 +0000 Received: by mail-pg1-x52c.google.com with SMTP id q15so5243248pgg.12 for ; Thu, 17 Jun 2021 08:34:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=Qo2U3OT7TQV2hfApkPoprjUOYDjiugcA+rK9f549H6A=; b=m6sPYsNGWXeZnW+FBmSlzqTO3qpHtH9zPClnELW5DmWuX2sfWe/UsEwQBLfDZXN11i cu2KnzstL1EK5pxcUtmW+fTCTLN39ZzYzXECnukxyU1HKoKXf1zG5+2yDGb8QjtfXsXc 2URud7Lx/oI7BV/Rsi3TliaMmr4JBfKUNpfsYw1uhGdE5/VtgU+POKe8ICgmMnWSLQQP ke3fifaEFKZ0aBjtIkhZ7n57x3F+O6X53QwhP5eoRsshpOOJhtpxADokOq8qnL8FN+3f vIaTYfs7qlnP5Cxpf2mbWCWm2iJRMyTu8XE+lwjboR/4UAO9Uny72qcfiiTcNgUE/uWg zX5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Qo2U3OT7TQV2hfApkPoprjUOYDjiugcA+rK9f549H6A=; b=mVTaFr7vN67QPDTT9cIjsPTcJtQ/aqYpuFi4RI3meQC31ai+GgJTy9+hZnFAfgL7+G bsq1BV9DzYM5U4RNzB0lWGvTum6flhJWRYslAYy/dEmcUlkmz2bs+K1rhpT30DV7M6iI 1agAdredLrfUuT3BBKtW5FUvez4Hrs/v/rKxJq/oQru99NvTrZqMsSsQqRACjHVjvEqJ 9GMSX4GYatJSO5eBkXiE06oTiSYC+qITmwkxWlS0bz3RecdF3W2h0k5AufDQhvK1+YkG GXMykjBFjwBwaslh0I0+RS+LPSGSTNMlOdN3D5YQc1bEHLeg3PMJ+NJTbUvxBOscS/ya /KiA== X-Gm-Message-State: AOAM530b7Sm1ug1a0vaL/91lXvlT3y0CQBBwg7OavAdtbzfLKQ3cM1g/ GfObeZxWS31JHw3i4PQCnts= X-Google-Smtp-Source: ABdhPJwV9O5MDCJn1wi4VfOQKqL37OaOa+JlcZ6yoHOfvrBhQxuiBxgCyqVV3If6+jY5OBZ0VrhPpQ== X-Received: by 2002:a62:7848:0:b029:2f7:4ecc:f14 with SMTP id t69-20020a6278480000b02902f74ecc0f14mr361699pfc.77.1623944094539; Thu, 17 Jun 2021 08:34:54 -0700 (PDT) Received: from nol (2001-b011-0008-f025-d963-d051-e6ec-9ba6.dynamic-ip6.hinet.net. [2001:b011:8:f025:d963:d051:e6ec:9ba6]) by smtp.gmail.com with ESMTPSA id v4sm6077397pgr.65.2021.06.17.08.34.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Jun 2021 08:34:54 -0700 (PDT) Date: Thu, 17 Jun 2021 23:34:41 +0800 From: Julien Rouhaud To: Vijaykumar Jain Cc: pgsql-general Subject: Re: compute_query_id Message-ID: <20210617153441.klssqpnou77zu5bd@nol> References: <20210617145026.ypll3a5iryjbks2h@nol> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Jun 17, 2021 at 08:57:02PM +0530, Vijaykumar Jain wrote: > > test=# show log_line_prefix; > log_line_prefix > -------------------------------- > [timestamp=%t] [query_id=%Q] : > (1 row) > > test=# show compute_query_id; > compute_query_id > ------------------ > on > (1 row) > > test=# show log_statement; > log_statement > --------------- > all > (1 row) > > ************************************* corrects myself > ..... ok now it works, when i set log_min_duration_statement =0 to log > all statements. > > test=# show log_min_duration_statement; > log_min_duration_statement > ---------------------------- > 0 > (1 row) Yes, unfortunately log_statements is not compatible with compute_query_id. This is documented at https://www.postgresql.org/docs/devel/runtime-config-logging.html#GUC-LOG-LINE-PREFIX: > The %Q escape always reports a zero identifier for lines output by > log_statement because log_statement generates output before an identifier can > be calculated, including invalid statements for which an identifier cannot be > calculated.