PostgreSQL CHARACTER VARYING vs CHARACTER VARYING (Length)

From: Rajin Raj <rajin(dot)raj(at)opsveda(dot)com>
To: pgsql-admin(at)lists(dot)postgresql(dot)org, pgsql-hackers(at)postgresql(dot)org
Subject: PostgreSQL CHARACTER VARYING vs CHARACTER VARYING (Length)
Date: 2020-04-28 09:22:07
Message-ID: CAOasRJYCUwMYdd=BL29TupW_iCbvM3YRM01YTB_WYSUEays3CA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-hackers

Is there any impact of using the character varying without providing the
length while creating tables?
I have created two tables and inserted 1M records. But I don't see any
difference in pg_class. (size, relpage)

create table test_1(name varchar);
create table test_2(name varchar(50));

insert into test_1 ... 10M records
insert into test_2 ... 10M records

vacuum (full,analyze) db_size_test_1;
vacuum (full,analyze) db_size_test_2;

Which option is recommended?

*Regards,*
*Rajin *

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Holger Jakobs 2020-04-28 09:43:39 Re: PostgreSQL CHARACTER VARYING vs CHARACTER VARYING (Length)
Previous Message Rui DeSousa 2020-04-28 07:32:19 Re: PostgreSQL DB checkpoint error!

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2020-04-28 09:41:27 Re: PATCH: logical_work_mem and logical streaming of large in-progress transactions
Previous Message Benjamin Schaller 2020-04-28 08:43:27 Raw device on PostgreSQL