Re: ALTER TABLE ADD COLUMN fast default

From: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>
To: Andrew Dunstan <andrew(dot)dunstan(at)2ndquadrant(dot)com>
Cc: David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: ALTER TABLE ADD COLUMN fast default
Date: 2018-02-04 20:49:43
Message-ID: CAEepm=11cJjko0CKA1KF=HKpiKzkikEFq641B3dSZa9v8HCV5g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jan 26, 2018 at 1:23 PM, Andrew Dunstan
<andrew(dot)dunstan(at)2ndquadrant(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2018-02-04 21:10:12 Re: WIP Patch: Precalculate stable functions, infrastructure v1
Previous Message Peter Geoghegan 2018-02-04 18:19:23 Re: pgsql: Support parallel btree index builds.