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 1tki9X-006BHn-Fe for pgsql-general@arkaria.postgresql.org; Wed, 19 Feb 2025 11:22:07 +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 1tki9W-007TaE-07 for pgsql-general@arkaria.postgresql.org; Wed, 19 Feb 2025 11:22:06 +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 1tki9V-007Ta4-M4 for pgsql-general@lists.postgresql.org; Wed, 19 Feb 2025 11:22:05 +0000 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tki9U-001hU7-0Z for pgsql-general@lists.postgresql.org; Wed, 19 Feb 2025 11:22:04 +0000 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-38f265c6cb0so2981406f8f.2 for ; Wed, 19 Feb 2025 03:22:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1739964123; x=1740568923; darn=lists.postgresql.org; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date :message-id:reply-to; bh=jdMjBpbHvq8CFJQIzuk2n7nAcylMW/PPe83bqIwfBtY=; b=YQGhX94QA64cBrhBr5ZZIyxc/e6onEFxBz1yHk6dxifrAFm35zdpx8dArMvRHVrPkM q8coWT8RYlL64bfr4CVgGou0TSMnV/+sw3dzLQ30q4vdbrfQovg1Aq6Xb6utHG98fDhs o1AMhmDS89ADmW15905DsW0gVWQ7eOe9SbQrL2HYDMnqqbsRfMU8DW2zBxSru2MJKpqr Q+rPhxLhNxiqFG/5S3exLKlbj56MI2W40Plhvf8CVkcrl5cxNLkHwaAqSjfscRhr0s4i D0cjkYQhnAdAeOrUBMFrDHJyTaGntoi5ABAb6X2Ela6vFGaplYvRG0J0swhmgCSYbt0H dIpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739964123; x=1740568923; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=jdMjBpbHvq8CFJQIzuk2n7nAcylMW/PPe83bqIwfBtY=; b=R3HhG0Y+9HzSpYdCNPaO94NK7yNxmBIDhtKa2xbihHPIHULfYsaqkhK4bzeJn3YW+k jtZZ54t0HFNOlSTc5+OsZx3X9x5GrKIdlG+YHgr9KFSs1KyKkEBsF2Wu7OKhE/BM7XtS VCbIBxfUbT6qO3YdqvRp99LX3fJffpnhrZ/f8e1T0tm6YRke4czp8MKYZQJhGDs5XPNv Ay2PsaDlUTaPE9yz6e2s3n1hkpXjIUOI6Vsefg+zpyj2dPFB8gs09HnV+Gnm9rSlUtwy YIXSAV9YbbzRIBOL188ZbO00QE/DhnN1W1zuviA3zgUBJOrX3GgRqHaLzOlbTD1rVf5q tNsw== X-Forwarded-Encrypted: i=1; AJvYcCWtFM7unyBL2RL4D/33W347L1bit3ZmwLvtlgJKWI2KzoLBGNzNA9XDD9dwoMUwAlWyQfVmPOxbez+qoFBj@lists.postgresql.org X-Gm-Message-State: AOJu0YxemzcVXQruyDzc6+2PKHt9p+LMbcnH2WFXixNSG6k4WCWHRQOE 7pVDoyKjQkATW5fhXW55/T1RS6hVEv2iHzI73DfFtspyoELDcp20AShYnrhTIKWmDNBl7rcxHag 7TEU0OnFLl4es2JkK+WOeukFjIBCObS6fos3UxEJEDrZlcYh3LCVphnJvys76YUNv X-Gm-Gg: ASbGncuXVRnxBUR1QkiIsC22Cin8LPafLTPY4hN1tQ9jPG/Lk934V1KqXBpDcbAzoqi kLd+jWteTNyO91BbSYpQuS2mt/UqS96ooVOBIU2ZTCH5PhwNIjhWdh2Y36A8u+YLxfzkraeKnzL uwXK6KXhUHjNx0DqzUyPaRUvLD64OHlpywjBVvPG7nRm+ecltbtXkHrKaSHpuL31ockLgh8MO3B 2CqsgtcdNp7MOo9djCDIs6v8a+hT1YrzkehJNv7rB84XuXFJgF9/aSeqzpPXAErgQz1BuKVH2Fe aH/F8RZxd+urg7FE/KGg/2DWknr0tXmeNFw= X-Google-Smtp-Source: AGHT+IEdMX5tQWLBVIcU7KznDuQviQMCoVrFcd3zV3wrmn9TyOgsMevN4CQndAoRsg0ox7ZjSNBbNg== X-Received: by 2002:a5d:47ce:0:b0:38f:3a89:fdae with SMTP id ffacd0b85a97d-38f3a8a019emr13340061f8f.46.1739964122764; Wed, 19 Feb 2025 03:22:02 -0800 (PST) Received: from localhost.localdomain ([2001:871:5e:517b:7a17:db82:bac2:ea1d]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38f258ccd3bsm17598414f8f.22.2025.02.19.03.22.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Feb 2025 03:22:02 -0800 (PST) Message-ID: <2b9a5afa4abfcdbab0a585c1a77279dc90a60a83.camel@cybertec.at> Subject: Re: ERROR: stack depth limit exceeded From: Laurenz Albe To: csanyipal@gmail.com, general pgsql Date: Wed, 19 Feb 2025 12:22:02 +0100 In-Reply-To: References: User-Agent: Evolution 3.54.3 (3.54.3-1.fc41) MIME-Version: 1.0 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 Wed, 2025-02-19 at 11:23 +0100, Cs=C3=A1nyi P=C3=A1l wrote: > I am running postgresql 15 on Debian 12 operating system. > I also installed PgAdmin4 and am using the desktop version of it. > I have created a trigger function and a trigger which will run the > following code, see below. > Before this trigger would run, I tried this code. > When running the code I get the following error message: > ERROR: stack depth limit exceeded HINT: Increase the configuration > parameter "max_stack_depth" (currently 2048kB), after ensuring the > platform's stack depth limit is adequate. >=20 > Where am I making a mistake, and what can I do to make this code and > this trigger run successfully? You don't show the entire functoin and the trigger definition, but from the symptoms it is pretty clear that the trigger is modifying the table on which it is defined. That will call the trigger again and lead to an endless recursion, which leads to the observed error. Yours, Laurenz Albe --=20 *E-Mail Disclaimer* Der Inhalt dieser E-Mail ist ausschliesslich fuer den=20 bezeichneten Adressaten bestimmt. Wenn Sie nicht der vorgesehene Adressat= =20 dieser E-Mail oder dessen Vertreter sein sollten, so beachten Sie bitte,=20 dass jede Form der Kenntnisnahme, Veroeffentlichung, Vervielfaeltigung oder= =20 Weitergabe des Inhalts dieser E-Mail unzulaessig ist. Wir bitten Sie, sich= =20 in diesem Fall mit dem Absender der E-Mail in Verbindung zu setzen. *CONFIDENTIALITY NOTICE & DISCLAIMER *This message and any attachment are=20 confidential and may be privileged or otherwise protected from disclosure= =20 and solely for the use of the person(s) or entity to whom it is intended.= =20 If you have received this message in error and are not the intended=20 recipient, please notify the sender immediately and delete this message and= =20 any attachment from your system. If you are not the intended recipient, be= =20 advised that any use of this message is prohibited and may be unlawful, and= =20 you must not copy this message or attachment or disclose the contents to=20 any other person.