I received an email offlist about a crash that a non-customer experienced
recently. I asked them to send a few details about the crash, so here it is.
Please note that I don't have access to their systems, but they will be fast
enough to provide data if needed. (They asked me to mask some of the table/func
They have a domain called primaryuuid:
CREATE DOMAIN primaryuuid AS uuid NOT NULL DEFAULT uuid_generate_v4();
and a table called foo1, which used to have this domain as a data type:
CREATE TABLE foo1 (
id public.primaryuuid NOT NULL,
They wanted to change id column from uuid to int, so created this func first:
CREATE FUNCTION foofunc_id_uuidtoint(chartoconvert uuid) RETURNS integer
LANGUAGE sql IMMUTABLE STRICT
SELECT newid FROM foo1 WHERE tempuuid = $1 LIMIT 1;
and ran this:
ALTER TABLE foo1 ALTER COLUMN id TYPE INTEGER USING
This command crashed postmaster. They connected to related process once again
with gdb, and got this:
Program received signal SIGSEGV, Segmentation fault.
slot_deform_tuple (slot=0x1b80440, natts=13) at heaptuple.c:1157
1157values[attnum] = fetchatt(thisatt, tp + off);
Below are some lines in postgresql.log:
ERROR: canceling autovacuum task
CONTEXT: automatic vacuum of table "foo1"
process 10884 acquired AccessExclusiveLock on relation 16961 of database 16401
after 1000.411 ms
STATEMENT: ALTER TABLE foo1 ALTER COLUMN id TYPE INTEGER USING
LOG: server process (PID 10884) was terminated by signal 11: Segmentation
Please note that this crash is not specific to this table. Various attempts to
change this data type on various tables also crashed postmaster.
This happened a few times, and after disabling autovacuum and lowering
maintenance_work_mem from 4GB to 2GB, they could complete all ALTER TABLE
This is PostgreSQL 9.5.4 on CentOS 6.8, fully up2date, and they are using the
Any ideas what is causing this crash?
Please let me know if you need more data.
PostgreSQL Danışmanı/Consultant, Red Hat Certified Engineer
Twitter: @DevrimGunduz , @DevrimGunduzTR
Description: This is a digitally signed message part