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.96) (envelope-from ) id 1wOG9M-001RfJ-0C for pgsql-general@arkaria.postgresql.org; Sat, 16 May 2026 14:37:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wOG9K-003HDf-2W for pgsql-general@arkaria.postgresql.org; Sat, 16 May 2026 14:37:54 +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.96) (envelope-from ) id 1wOG9K-003HDX-1X for pgsql-general@lists.postgresql.org; Sat, 16 May 2026 14:37:54 +0000 Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wOG9I-00000000wFU-11cN for pgsql-general@lists.postgresql.org; Sat, 16 May 2026 14:37:54 +0000 Received: by mail-ed1-x52d.google.com with SMTP id 4fb4d7f45d1cf-682714e8f9eso2375634a12.0 for ; Sat, 16 May 2026 07:37:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1778942271; cv=none; d=google.com; s=arc-20240605; b=DReZfhcdOD5x/GQpY9NBj1OZyiug4hSBZHRHBZ2N/7mk7jfrpFCgBGtz045XdPGh40 k8cWWtTOmSzzSxzZcX4nO441m0wckYmui2vhMf3vkPTmlOCBReI69GlBNyjPxVaDJQyQ A5YuB//9SvcBieCoPRe3YxvBWoLteMpTvoJcaHVLqoQxZjMwZ30K/9e05BbjqaJlEf+M FlkousePnNZtWYqQO4mhAqOK4xcB5I8X+LcLO+32w/LIrUVJYZzRds3TSu4mNdWB2qpj sju0d1Lbmj/eV6KqN1pMSrjHi7yjMiojbRrsJTYhJrO4vS5gn6xQWfmY32IMY5BMOSw9 jFAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=7QMMzOwJvHbK6qz9M3wWuD+efVlVfPLYUxZhIkOzUec=; fh=hRAzYEZuiIsieOXa1o/5606rJmFanijXBPF9n7ZtHjU=; b=cdLTT3Jw3hZYULMNkkRx5qtmh0pjnkbQqxGfrojnudYO5+AZHtW3nr6QbuGsDcSCwW BCxqsqp1BQxqbFVqcWnhcEPuUaOQc/jAt5xxf7nF1FCVo90QNZ/HQlJk0zjPAyUOQgIg es5wLHlXJRRd6iJmCPVxkA98uTDeWigfIqdDezQVXnGYLw97Znfyzx51uoIklZ2RIh1g dzEP2lNsPE1BLRg1+tfg6pHawGCXhHHRBvcGaqwvMAaoMGufZF6FVETE0Jrl2TSqJDsn joqL+A6kw4FOopCgWyA1UQkorUd4DOp7D0ivsArRADwD2llbdv5dUAhQ+ol8WkpfyurS CGdw==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778942271; x=1779547071; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=7QMMzOwJvHbK6qz9M3wWuD+efVlVfPLYUxZhIkOzUec=; b=RFDfBYof075EZ5oLvLpOSPrfxSKFUyqkbbTgqsNjUGvOJlwoeWRLLs+hEUuYZlequV /teydjOGCdtqcKT5DVOc2rff5nlJUKIaOE6SKw6pO+KwU+zCw5Zk+Ez+XfZ4xlpfbf2C r4E3Ap17DTuzRciX0kLjegRWNF+3cgQWjZC9P61F5Y0OoPVU5qLqoU7h2oT2RLJYt3DL u9mrdSraOYeTWdWptk4z3RCLo3mP8vymGEUCuObHdB4gRC1fnmWtvv7Bp8JkeZxHpCe8 KEtDsAHRqDqtYK+TUxaUe3fYT1lzHlVFy9nAjDATFD9P6O117ZwpOSJRSsP49mgN1yl4 ey+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778942271; x=1779547071; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=7QMMzOwJvHbK6qz9M3wWuD+efVlVfPLYUxZhIkOzUec=; b=tIRBAIGi4Co+7WVU6Ls6daIIK1ypMt7CgtS6SKIopw+SbXPdXL5G6HkQARktKDeNoA lC6urP/uVs8nTX4buhSNoH1KZRgbplgYdzDok7HWX+wZQo6j2ld57u6+kE2MGa8mqRTO 57RCNwoaaIBoEzwI3RbOToXf+grz1Rcr4OCeI8jOgqfQVYRwhtCqtzE8DXtGlMiOJbQc 048AWd9LSP1Pmt4qB2ZwqYzTZToplw/TlfSEIQhOrrnJ1pgViLr8j2I0IotHE+aJAHKE yI5laO+1au7uubFm/IsibOUnsioHb7b3EVKWenxuOZcoN6l8i2TGM2DZvgIHDwAeQomV Rknw== X-Forwarded-Encrypted: i=1; AFNElJ8c0tsjqG+Pj18sr0Lh8hnK7m85kXV946vl6N2HUx7Xl6ff8h1/Zpu0BhLR0rIzTmpjUWrV7sLhksKk9ptU@lists.postgresql.org X-Gm-Message-State: AOJu0YzpDbjc0wcgbbOIYod3+ZiE9kVtvWIES7jbAIE01NEM0BZaYZCW /+hpQLL20VNBNgAOacYwVgHyI5f6JJSs5D1SeA8GX/MziWF1floycEN5NDFQANcVE5sR21b8ZHA ouY9ZmH9/8CT2w0TSlvGgf7nPtiE4LJiUF78ysN35Dw== X-Gm-Gg: Acq92OHt52d0WmqZOzwaoKlN5iXfUa9LzyjYGXycAmv8ws7g+nW3DMh/8Bbf9JOhK2D GaR+SAGv77lhFPzto//Gbtyit/8X5PiFyVoWCDoOU4Z4Wizb03ADG2J4CEB5vHRKdYmlxHkKy0K q2fydKu64J1wVWAq40I+U139JPmrn7X0uBQq/rEVqruz2sDNoHXgENgUMOYq2EmFjd2Y23mMl7c y0wRY4I5HtF6/6ADnF7LhXbb2Fod5vCyxdPgP7zn1RY00qFGQ+NTCVdfbbZMY7eWV+4ERJSL5kU HIsqIwsyG4XzdobfP31Afr7K3dgeCw== X-Received: by 2002:a05:6402:46d3:b0:683:9a51:306b with SMTP id 4fb4d7f45d1cf-683b4b8f946mr3050506a12.9.1778942270638; Sat, 16 May 2026 07:37:50 -0700 (PDT) MIME-Version: 1.0 References: <1495292.1778939187@sss.pgh.pa.us> <02D2D7C5-7932-4030-B65A-4BECB645E9F0@gmail.com> In-Reply-To: From: Vladimir Sitnikov Date: Sat, 16 May 2026 17:37:38 +0300 X-Gm-Features: AVHnY4Jd_QqiU6UBZA_FOGMI_K8JSUzXYqR7bNJKRDMGvgHcDhWxKdcg0Ci6ABw Message-ID: Subject: Re: Double prepare To: Igor Korot Cc: Tom Lane , "pgsql-generallists.postgresql.org" , Rob Sargent Content-Type: multipart/alternative; boundary="0000000000001e0fd10651f04615" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000001e0fd10651f04615 Content-Type: text/plain; charset="UTF-8" A couple more things to keep in mind: 1) The client has to re-prepare statements on "deallocate all", "alter", "create", "drop", "alter", "set search_path" statements. The backend does not automatically keep the prepared statement workable across those calls. The offending error messages are "ERROR: cached plan must not change result type", "ERROR: prepared statement "S_2" does not exist" 2) I've an answer regarding "prepared statement lifespan" at https://stackoverflow.com/questions/32297503/whats-the-life-span-of-a-postgresql-server-side-prepared-statement/32300222#32300222 Looking forward to adding more references there. Feel free pinging me in the comments. Vladimir --0000000000001e0fd10651f04615 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
A couple more things to keep in mind:
1) The clien= t has to re-prepare statements on "deallocate all", "alter&q= uot;, "create", "drop", "alter", "set se= arch_path" statements.
The backend does not automatically keep the = prepared statement workable across those calls.
The offending error mess= ages are "ERROR: cached plan must not change result type", "= ERROR: prepared statement "S_2" does not exist"

2) I&= #39;ve an answer regarding "prepared statement lifespan" at=C2=A0= https://= stackoverflow.com/questions/32297503/whats-the-life-span-of-a-postgresql-se= rver-side-prepared-statement/32300222#32300222
Looking forward to ad= ding more references there. Feel free pinging me in the comments.

Vladimir

--0000000000001e0fd10651f04615--