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 1sJh3W-006GxW-MS for pgsql-admin@arkaria.postgresql.org; Tue, 18 Jun 2024 22:11:58 +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 1sJh3U-004QYK-0r for pgsql-admin@arkaria.postgresql.org; Tue, 18 Jun 2024 22:11:56 +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 1sJh3T-004QYC-Jv for pgsql-admin@lists.postgresql.org; Tue, 18 Jun 2024 22:11:56 +0000 Received: from mail-pg1-x52a.google.com ([2607:f8b0:4864:20::52a]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sJh3S-002Lvt-8X for pgsql-admin@lists.postgresql.org; Tue, 18 Jun 2024 22:11:55 +0000 Received: by mail-pg1-x52a.google.com with SMTP id 41be03b00d2f7-6e7b121be30so4210084a12.1 for ; Tue, 18 Jun 2024 15:11:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718748711; x=1719353511; darn=lists.postgresql.org; h=to:message-id:subject:date:mime-version:from :content-transfer-encoding:from:to:cc:subject:date:message-id :reply-to; bh=xLbSgNrPKzQRmNmkkP0Hb6nKIyJ48N3k3xbGfj0jxaw=; b=TSzTl+jvlK6MGf/f6PGeCjLpPnk311LYBj2VsCHbtIMSXgOmpmgerKH9VD14xtRuN0 V9GHrj3wXA6XkqciJcht+fbNSCowOIDwmy3qz8lYvBGmy+I9P5nz18alNQvYz8KG2k6j 551AzdAZipkd6jLBEBIqZQUlNt2QG/0DH4I5QXV5+OgKo9xJ3KSZPud3/NyVFJ/IGeb9 mEmfxZaUSNN6HpC2dqkzq/As/Y5Bp/5Yq88U1HwJB4tK8JP8Yk3G26kYlqIjuJYwvcmD 0TEvjTCbn8F+UMrxqEbIuSlCco/CsUyXuuMpiO9O4UlgGyPkO2IiKf75e9kQ1OYBpXor FY5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718748711; x=1719353511; h=to:message-id:subject:date:mime-version:from :content-transfer-encoding:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=xLbSgNrPKzQRmNmkkP0Hb6nKIyJ48N3k3xbGfj0jxaw=; b=h1HlzYjpkjOQ+n/SlvJGMXpHXnCRztydo8k6vTY0rjvOmg/nt+VBtU4RrUFhtfxlOh b+kWpdQqaw8aQo8H1ZA1eM3CW1mt/qpESvRMRciLF+X9ztbx98TgOTisFO6fY5+pNHCf BOHEVdo0x71snx6YBoRXE5hsW+2hUyrcnCsw8K/DFvdC4D5lyxjvMTjaLapQwORRs5N4 jfqkoJDU9I9eeqxgAIdSELAITW3r+TjiF6A5LTI7Up/awbqm1IN4/ln9THa9T1Mie3Dw Kluueh/yNfPFXYfgSY0fPOp4dMjEnYTwyfPr98a7SBNL/rHTOSQWujesIG/zMTsjZhWe y/YQ== X-Gm-Message-State: AOJu0YwZyjENboHWxE43cZBrx8VIS5mlHlruyNUwo670sIs3p1elqFSQ ytKB9I7r8QWj3NUrGawltcCTlZPA54jyiKW1ULwTj6Trzog8E/aK4MMM6Q== X-Google-Smtp-Source: AGHT+IGPjira0jDbQTXpiD8Zzu6VUw94mktuimQGx3GnQNK49sD5WL+XSOH3+zr875xofKYKKI72Kg== X-Received: by 2002:a17:903:2385:b0:1f9:8c1f:d535 with SMTP id d9443c01a7336-1f9aa470be1mr10013875ad.58.1718748711312; Tue, 18 Jun 2024 15:11:51 -0700 (PDT) Received: from smtpclient.apple ([2603:8001:203:f62:28d5:6251:9347:d160]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f855e726a8sm102202115ad.99.2024.06.18.15.11.50 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 18 Jun 2024 15:11:50 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Teja Jakkidi Mime-Version: 1.0 (1.0) Date: Tue, 18 Jun 2024 15:11:39 -0700 Subject: Statement_timeout in procedure block Message-Id: To: pgsql-admin X-Mailer: iPhone Mail (21F90) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello PgAdmins, We have a Postgres instance where we had set statement_timeout to 1hour at i= nstance level. However, today we noticed that one of our cron jobs which calls a stored pro= cedure failed with timeout error as it was running for more than an hour. I tried setting =E2=80=9CSet local statement_timeout=3D=E2=80=982 h=E2=80=99= =E2=80=9D within the stored procedure expecting that the statement timeout w= ill be 2hours for the SP execution. However it did not work as expected.=20 Can anyone please suggest what can be done here. Thanks in advance, J. Teja.=