Re: ALTER TABLE ADD COLUMN fast default
Thomas Munro <thomas.munro@enterprisedb.com>
From: Thomas Munro <thomas.munro@enterprisedb.com>
To: Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
Cc: David Rowley <david.rowley@2ndquadrant.com>, Tom Lane <tgl@sss.pgh.pa.us>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2018-02-04T20:49:43Z
Lists: pgsql-hackers
On Fri, Jan 26, 2018 at 1:23 PM, Andrew Dunstan <andrew.dunstan@2ndquadrant.com> wrote: > Yeah, thanks. revised patch attached FYI the identity regression test started failing recently with this patch applied (maybe due to commit 533c5d8bddf0feb1785b3da17c0d17feeaac76d8?) *** /home/travis/build/postgresql-cfbot/postgresql/src/test/regress/expected/identity.out 2018-02-04 00:56:12.146303616 +0000 --- /home/travis/build/postgresql-cfbot/postgresql/src/test/regress/results/identity.out 2018-02-04 01:05:55.217932032 +0000 *************** *** 257,268 **** INSERT INTO itest13 VALUES (1), (2), (3); -- add column to populated table ALTER TABLE itest13 ADD COLUMN c int GENERATED BY DEFAULT AS IDENTITY; SELECT * FROM itest13; ! a | b | c ! ---+---+--- ! 1 | 1 | 1 ! 2 | 2 | 2 ! 3 | 3 | 3 (3 rows) -- various ALTER COLUMN tests --- 257,269 ---- INSERT INTO itest13 VALUES (1), (2), (3); -- add column to populated table ALTER TABLE itest13 ADD COLUMN c int GENERATED BY DEFAULT AS IDENTITY; + ERROR: column "c" contains null values SELECT * FROM itest13; ! a | b ! ---+--- ! 1 | 1 ! 2 | 2 ! 3 | 3 (3 rows) -- various ALTER COLUMN tests -- Thomas Munro http://www.enterprisedb.com
Commits
-
Clean up treatment of missing default and CHECK-constraint records.
- 091e22b2e673 14.0 landed
-
Fast ALTER TABLE ADD COLUMN with a non-NULL default
- 16828d5c0273 11.0 landed
-
Fix application of identity values in some cases
- 533c5d8bddf0 11.0 cited