pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: s.shinderuk@postgrespro.ru
Subject: BUG #17706: ALTER TYPE leads to crash
Date: Wed, 07 Dec 2022 20:16:30 +0000
Message-ID: <17706-fa10a46c1ac9ce5a@postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      17706
Logged by:          Sergey Shinderuk
Email address:      s.shinderuk@postgrespro.ru
PostgreSQL version: 15.1
Operating system:   Ubuntu 22.04
Description:        

With PL/pgSQL:

create type foo as (a int, b int);

create function bar() returns record as $$
declare
        r foo := row(123, 2^30);
begin
        alter type foo alter attribute b type text;
        return r;
end;
$$ language plpgsql;

postgres=# select bar();
server closed the connection unexpectedly
  This probably means the server terminated abnormally
  before or while processing the request.

LOG:  server process (PID 394076) was terminated by signal 11: Segmentation
fault

(Here 2^30 is interpreted as a string length.)


With a cursor:

postgres=# create type foo as (a int, b int);
CREATE TYPE
postgres=# begin;
BEGIN
postgres=*# declare c cursor for select (i, 2^30)::foo from
generate_series(1,10) i;
DECLARE CURSOR
postgres=*# fetch c;
      row       
----------------
 (1,1073741824)
(1 row)

postgres=*# fetch c;
      row       
----------------
 (2,1073741824)
(1 row)

postgres=*# alter type foo alter attribute b type text;
ALTER TYPE
postgres=*# fetch c;
server closed the connection unexpectedly
	This probably means the server terminated abnormally
	before or while processing the request.



view thread (6+ messages)  latest in thread

Message-ID: <17706-fa10a46c1ac9ce5a@postgresql.org>
Permalink:  ../17706-fa10a46c1ac9ce5a@postgresql.org/
Also on:    postgresql.org/message-id/17706-fa10a46c1ac9ce5a@postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, s.shinderuk@postgrespro.ru
  Subject: Re: BUG #17706: ALTER TYPE leads to crash
  In-Reply-To: <17706-fa10a46c1ac9ce5a@postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox