Postgres 12 - default value for text column

From: Raj Gandhi <raj01gandhi(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Postgres 12 - default value for text column
Date: 2020-08-04 20:35:16
Message-ID: CALU_HCMK1Ws6RbF3bupWrZ35kXsyTTzbeCM_njC2+8-aXM9PBQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

The following alter table with default set to very large text used to work
in Postgres 10 but fails in Postgres 12 with *ERROR: row is too big: size
12960, maximum size 8160*

create table test (id int);
alter table test1 add column license text DEFAULT '<insert default text
with size more than 8160 >'

The following two variants works in Postgres 12 without any error:

create table test (id int);
alter table test1 add column license text
alter table test1 alter column license SET DEFAULT '<insert default text
with size more than 8160 >'

create table test (id int, license text DEFAULT '<insert default text
with size more than 8160 >' );

Thanks in advance.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Dan shmidt 2020-08-04 20:40:20 Logical replication from multiple masters - master starvation
Previous Message Mariya Rampurawala 2020-08-04 15:23:22 PostgreSQL-12 replication. Check replication lag