Re: [BUGS] Commenting a FK crashes ALTER TABLE statements
От | David Rowley |
---|---|
Тема | Re: [BUGS] Commenting a FK crashes ALTER TABLE statements |
Дата | |
Msg-id | CAKJS1f9HdROUL+2OsSSeLfEgkFuxUnuySP_s0mLpHcVjjLESzQ@mail.gmail.com обсуждение исходный текст |
Ответ на | [BUGS] Commenting a FK crashes ALTER TABLE statements (Marko Elezovic <marko.elezovic@oradian.com>) |
Ответы |
Re: [BUGS] Commenting a FK crashes ALTER TABLE statements
|
Список | pgsql-bugs |
On 15 May 2017 at 03:43, Marko Elezovic <marko.elezovic@oradian.com> wrote: > Script to reproduce: > > psql -Upostgres -c"DROP DATABASE IF EXISTS cod;" postgres > > psql -Upostgres -c"CREATE DATABASE cod;" postgres > > psql -Upostgres -c"CREATE TABLE foo(id int PRIMARY KEY);" cod > > psql -Upostgres -c"CREATE TABLE bar(id int CONSTRAINT baz REFERENCES > foo);" cod > > psql -Upostgres -c"COMMENT ON CONSTRAINT baz ON bar IS 'Fubar';" cod > > psql -Upostgres -c"ALTER TABLE foo ALTER COLUMN id TYPE int;" cod Thanks for detailing out the method to reproduce. It can be simplified a bit to become: CREATE TABLE foo(id int PRIMARY KEY); CREATE TABLE bar(id int CONSTRAINT baz REFERENCES foo); COMMENT ON CONSTRAINT baz ON bar IS 'Fubar'; \c ALTER TABLE foo ALTER COLUMN id TYPE int; It seems there's just some missing pstrdup() calls in RebuildConstraintComment(). The attached should fix it. -- David Rowley http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs
Вложения
В списке pgsql-bugs по дате отправления: