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 1wQ9mC-001KE2-1u for pgsql-bugs@arkaria.postgresql.org; Thu, 21 May 2026 20:13:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wQ9m8-00AwAg-1h for pgsql-bugs@arkaria.postgresql.org; Thu, 21 May 2026 20:13:49 +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.96) (envelope-from ) id 1wQ9m8-00AwAW-0c for pgsql-bugs@lists.postgresql.org; Thu, 21 May 2026 20:13:49 +0000 Received: from mail-vk1-xa31.google.com ([2607:f8b0:4864:20::a31]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wQ9m7-000000009Hb-20UU for pgsql-bugs@lists.postgresql.org; Thu, 21 May 2026 20:13:48 +0000 Received: by mail-vk1-xa31.google.com with SMTP id 71dfb90a1353d-575267e3398so5392482e0c.1 for ; Thu, 21 May 2026 13:13:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779394425; x=1779999225; darn=lists.postgresql.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id:from :to:cc:subject:date:message-id:reply-to; bh=//CObLtNIYueLPCQMx7xejY+QwW/TZeySXd61hN5Aog=; b=YA6yF72dK/CzQ4KUn6xzfdIjjYLclrPk2kbV/HHCpjw1WUZILNU0WA51kLUHBx4lCp BVUuNlY57xn45pXIMgfoS/GrAV+z5wRD7xC9bTz1DK/sP1g57gzkZj6ItORY2XyLQe2o tN8XldNZu+AsGIon14L/OYMCBLs3EEUkw187vbTOKtKkzSywI+OkXT4a10GgPg1hgYb7 L8hmm3/oZCVPtqupWAsu/dWMImL6NxQMEfZnIrnld52RhAC2TvXFAWGKEPGbtm6Ql/mc EipsBc0gsKT/sfkpNvcHbdvCq79AsuZI4+2Pf7YgDfWKofhOuPw262LHgf41b55o46e6 AptA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779394425; x=1779999225; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=//CObLtNIYueLPCQMx7xejY+QwW/TZeySXd61hN5Aog=; b=n0n2t33lWXm9S9879itDK7oYijDuKm6BFMD2Ae0C6emeqcmHKSEy1Rh3wuJKNjbXiQ yegURWDNhk2nlotvjP7ZiRxD0UxsgBpA2efqPw5XQT0HpQ7YrrQS3rrVCLyyAISQIs+D Rpqn/X6wr6Cr+Q29ly6uxpplAJ8GsYhUrXlhU0XAeV+3t1bvA7NOQxTw/Sjo24qpBfuQ yGsKS5UVHip66hcjRiNN4I297kzKV8uOCZKCoWuFOY7jyezeHxMj5A71Zl6aDbcWnje5 ThPrMuH8D7paHBRS9ukv+tCT0TjhWnbw6bErAkGkRYZ6S0IJCM3b5zgQodicYwkgCdPK Ws3A== X-Forwarded-Encrypted: i=1; AFNElJ+d6NmbFwcbowsVJMW5x2bOVEcwo9Q4ZQfWsruq+e4X0ny4/woe87jSOEfsFF4T3osujZDVqPE8aKhM@lists.postgresql.org X-Gm-Message-State: AOJu0YwgVVZp80eWs44O7rsf4f5GCDizBa2/wiMd0GmhafEnaTLvDfKL +MwGD1dG47HWQkstvSqAK9w46G7l04hbsHMwDD8kp1SQj8272bNfp252 X-Gm-Gg: Acq92OEniVBsxqu/6CAxp4KE+cA72aXtvHOLGG84SuiPs/4jebg7+KIZ0XorHy89DMv 2mkFyg4+tQz2Eq5u7/BmHW3snnBD9kNnPFYcQPwpO4slBEXyJ6wRS+8aCK5yG8hTkbylym+nu/m zDvcUVlSbabzc9f57lmptgXGpZZx3o9KWFdizYR6lLMDM/86CjRtYaVtBnQ1YwvYQyd6QSIX1U1 Q1fYP/aAOEiQn8u0lIb9IhOoCksGvChTgljEFze51yJM67cwQsv2ku9kF3AXswKb1ELd/LqskcA smzaEZg+EU8hhuhnK4aFJCImmHHpZ/vLzB9dR03WtzG/klwwVexXBJFQrhU3xBZ2BFE3C9jMXWo ypUp3GgudlFDBjF8IdfQHT6fMe5EqY+pmk0BbZCO9GBNwcDFKMe2XTld9IXSnpgRPfRTEspmezj ShORdgoPrQnuyaEgxocJlnr/O2cl6LaX/1/F+EXT5k+etZcCySDM7iNdBYl8p51KKKmUV/oczR1 TeOd8Yw/fdoa4HxURM= X-Received: by 2002:a05:6122:da5:b0:56a:fcbf:8aa4 with SMTP id 71dfb90a1353d-5865ea8bfe4mr588611e0c.2.1779394425367; Thu, 21 May 2026 13:13:45 -0700 (PDT) Received: from ?IPV6:2804:14d:328a:a59c:4ce5:985:14dc:4308? ([2804:14d:328a:a59c:4ce5:985:14dc:4308]) by smtp.gmail.com with ESMTPSA id 71dfb90a1353d-58699a67ec9sm255390e0c.5.2026.05.21.13.13.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 21 May 2026 13:13:45 -0700 (PDT) Message-ID: <9511d047-1a08-404b-a502-463fa599f152@gmail.com> Date: Thu, 21 May 2026 17:13:42 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: BUG #19469: Prevent SIGSEGV on FETCH after ALTER TYPE of cursor rowtype To: haogangmao@gmail.com, pgsql-bugs@lists.postgresql.org, PG Bug reporting form References: <19469-e7612f56d0e1ce34@postgresql.org> Content-Language: en-US From: Matheus Alcantara In-Reply-To: <19469-e7612f56d0e1ce34@postgresql.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 27/04/26 07:53, PG Bug reporting form wrote: > The following bug has been logged on the website: > > Bug reference: 19469 > Logged by: HaoGang Mao > Email address: haogangmao@gmail.com > PostgreSQL version: 17.3 > Operating system: OS: Linux (Docker) > Description: > > An open cursor can continue returning tuples built with the old physical > layout of a named composite type. If that type is changed in the same > transaction (for example ALTER TYPE ... ALTER ATTRIBUTE ... TYPE), a later > FETCH may format the tuple using updated descriptor and output metadata. > > Minimal Reproduction SQL: > ```sql > CREATE TYPE foo AS (a INT, b INT); > BEGIN; > DECLARE c CURSOR FOR > SELECT (i, power(2, 30))::foo > FROM generate_series(1,10) i; > FETCH c; > ALTER TYPE foo ALTER ATTRIBUTE b TYPE TEXT; > FETCH c; > COMMIT; > ``` It looks the same as as [1] and [2] [1] https://www.postgresql.org/message-id/19466-dc32827173299fd4%40postgresql.org [2] https://www.postgresql.org/message-id/19382-4c2060ffee72759b%40postgresql.org -- Matheus Alcantara EDB: https://www.enterprisedb.com