Re: pgsql: Fix table rewrites that include a column without a default.

2019-10-16 Thread Andres Freund
Hi, On 2019-10-10 17:16:08 -0400, Tom Lane wrote: > If you just want to verify that a rewrite happened or didn't happen, > seems like you could check whether the table's relfilenode changed. > > regression=# select relfilenode as oldfilenode from pg_class where relname = > 'rewrite_test' > regre

Re: pgsql: Fix table rewrites that include a column without a default.

2019-10-15 Thread Michael Paquier
On Thu, Oct 10, 2019 at 05:16:08PM -0400, Tom Lane wrote: > I really really don't want an event trigger running in everything that > runs in parallel with alter_table. That's a debugging nightmare of > monster proportions. +1, that's not stable. elver has just complained about a side effect of t

Re: pgsql: Fix table rewrites that include a column without a default.

2019-10-10 Thread Tom Lane
Andres Freund writes: > On 2019-10-10 16:51:23 -0400, Tom Lane wrote: >> Do you *really* need an event trigger to test this? > No. I added it to avoid the tests getting "accidentally" optimized away, > the next time somebody adds some ALTER TABLE optimizations. The fast > default stuff had remove

Re: pgsql: Fix table rewrites that include a column without a default.

2019-10-10 Thread Andres Freund
Hi, On 2019-10-10 16:51:23 -0400, Tom Lane wrote: > Andres Freund writes: > > Fix table rewrites that include a column without a default. > > This patch added use of an event trigger in alter_table.sql. > As we have learned the hard way, it's not acceptable to create event > triggers in test scr

Re: pgsql: Fix table rewrites that include a column without a default.

2019-10-10 Thread Tom Lane
Andres Freund writes: > Fix table rewrites that include a column without a default. This patch added use of an event trigger in alter_table.sql. As we have learned the hard way, it's not acceptable to create event triggers in test scripts that run in parallel with anything else, because they will

pgsql: Fix table rewrites that include a column without a default.

2019-10-09 Thread Andres Freund
Fix table rewrites that include a column without a default. In c2fe139c201c I made ATRewriteTable() use tuple slots. Unfortunately I did not notice that columns can be added in a rewrite that do not have a default, when another column is added/altered requiring one. Initialize columns to NULL aga

pgsql: Fix table rewrites that include a column without a default.

2019-10-09 Thread Andres Freund
Fix table rewrites that include a column without a default. In c2fe139c201c I made ATRewriteTable() use tuple slots. Unfortunately I did not notice that columns can be added in a rewrite that do not have a default, when another column is added/altered requiring one. Initialize columns to NULL aga