You don't need maximum length for PostgreSQL columns

In PostgreSQL unlike SQL Server or some other databases, we don't need to specify the max length for varchar or char data types. Based on the Postgres official documentation, in most cases we can use text field that is identical to nvarchar(MAX) in other database systems.

There is no performance difference among these three types(char, varchar, text), apart from increased storage space when using the blank-padded type, and a few extra CPU cycles to check the length when storing into a length-constrained column. While character(n) has performance advantages in some other database systems, there is no such advantage in PostgreSQL; in fact character(n) is usually the slowest of the three because of its additional storage costs. In most situations, text or character varying should be used instead.

If we want to limit the length of a column, we can use constraints rather than restricting the size of the field:

CREATE TABLE product
(
    id serial PRIMARY KEY,
    title text CONSTRAINT title_length CHECK(length(title) < 50) NOT NULL
);

With this approach, we can easily modify or drop the constraint without having to modify the table definition.