On Mon, May 15, 2017 at 1:05 PM, David Rowley
<david.rowley@2ndquadrant.com> wrote:
> 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.
I was just finishing to debug it :)
It is surprising that we have not caught this earlier as comment
re-creation handling in ALTER TABLE has been reworked some time ago
already. This means that we did not stress this code enough. Attached
is the previous fix, completed with a set of regression tests.
--
Michael
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs