Re: BUG #15446: Crash on ALTER TABLE

From: Dmitry Molotkov <aldarund(at)gmail(dot)com>
To: alvherre(at)2ndquadrant(dot)com
Cc: Andres Freund <andres(at)anarazel(dot)de>, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #15446: Crash on ALTER TABLE
Date: 2018-10-26 23:13:06
Message-ID: CADfhRDK+Rs4emhbfnkiQFHVKj2qhJuPzyaqnNnVwLbqQHSvOLA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

Here is query that make it crash

BEGIN;
--
-- Alter field related_modal_background_opacity on theme
--
ALTER TABLE "admin_interface_theme" ALTER COLUMN
"related_modal_background_opacity" TYPE varchar(5) USING
"related_modal_background_opacity"::varchar(5);
COMMIT;

And here all queries that was run before it

https://gist.github.com/aldarund/60c259a4011a5925b46bfcde47df7cb2

And here is table structure before failing migration

CREATE TABLE public.admin_interface_theme
(
id integer NOT NULL DEFAULT
nextval('admin_interface_theme_id_seq'::regclass),
name character varying(50) COLLATE pg_catalog."default" NOT NULL,
active boolean NOT NULL,
title character varying(50) COLLATE pg_catalog."default" NOT NULL,
title_visible boolean NOT NULL,
logo character varying(100) COLLATE pg_catalog."default" NOT NULL,
logo_visible boolean NOT NULL,
css_header_background_color character varying(18) COLLATE
pg_catalog."default" NOT NULL,
title_color character varying(18) COLLATE pg_catalog."default" NOT NULL,
css_header_text_color character varying(18) COLLATE
pg_catalog."default" NOT NULL,
css_header_link_color character varying(18) COLLATE
pg_catalog."default" NOT NULL,
css_header_link_hover_color character varying(18) COLLATE
pg_catalog."default" NOT NULL,
css_module_background_color character varying(18) COLLATE
pg_catalog."default" NOT NULL,
css_module_text_color character varying(18) COLLATE
pg_catalog."default" NOT NULL,
css_module_link_color character varying(18) COLLATE
pg_catalog."default" NOT NULL,
css_module_link_hover_color character varying(18) COLLATE
pg_catalog."default" NOT NULL,
css_module_rounded_corners boolean NOT NULL,
css_generic_link_color character varying(18) COLLATE
pg_catalog."default" NOT NULL,
css_generic_link_hover_color character varying(18) COLLATE
pg_catalog."default" NOT NULL,
css_save_button_background_color character varying(18) COLLATE
pg_catalog."default" NOT NULL,
css_save_button_background_hover_color character varying(18) COLLATE
pg_catalog."default" NOT NULL,
css_save_button_text_color character varying(18) COLLATE
pg_catalog."default" NOT NULL,
css_delete_button_background_color character varying(18) COLLATE
pg_catalog."default" NOT NULL,
css_delete_button_background_hover_color character varying(18) COLLATE
pg_catalog."default" NOT NULL,
css_delete_button_text_color character varying(18) COLLATE
pg_catalog."default" NOT NULL,
css text COLLATE pg_catalog."default" NOT NULL,
list_filter_dropdown boolean NOT NULL,
related_modal_active boolean NOT NULL,
related_modal_background_color character varying(18) COLLATE
pg_catalog."default" NOT NULL,
related_modal_background_opacity double precision NOT NULL,
related_modal_rounded_corners boolean NOT NULL,
logo_color character varying(18) COLLATE pg_catalog."default" NOT NULL,
recent_actions_visible boolean NOT NULL,
favicon character varying(100) COLLATE pg_catalog."default" NOT NULL,
CONSTRAINT admin_interface_theme_pkey PRIMARY KEY (id)
)
WITH (
OIDS = FALSE
)

пн, 22 окт. 2018 г. в 20:23, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>:

> On 2018-Oct-20, Dmitry Molotkov wrote:
>
> > Reproduce is easy if you can install python 3.
> > Here is empty django project that will reproduce it
> > https://www.dropbox.com/s/4rw2dlzxvxxb5xf/djangotestpgbug.zip?dl=0
> > install requirements from requirements file.
> > in djangotestpgbug\settings.py - set postgres user/password/database.
> > python manage.py migrate - it will run migration and it will crash
> > postgres:latest from docker. Didnt tried without docker. But i dont think
> > docker has anything to do with it.
> >
> > Here is failing migration
> >
> https://github.com/fabiocaccamo/django-admin-interface/blob/master/admin_interface/migrations/0008_change_related_modal_background_opacity_type.py
>
> I think the easiest is to turn DDL logging in the server
> (log_statement=ddl) and then report exactly what is being sent to the
> server, then see if you can construct a reproducer SQL script based on
> that.
>
> --
> Álvaro Herrera https://www.2ndQuadrant.com/
> PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
>

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Alvaro Herrera 2018-10-27 01:11:40 Re: BUG #15446: Crash on ALTER TABLE
Previous Message Jeff Janes 2018-10-26 14:08:00 Re: BUG #15459: no connection to the server

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2018-10-27 01:11:40 Re: BUG #15446: Crash on ALTER TABLE
Previous Message Thomas Munro 2018-10-26 21:38:28 Re: Comment fix and question about dshash.c