Can we create a column with a changing character (MAX) with a PostgreSQL database

I cannot set the maximum size of a specific column in PostgreSQL with the keyword MAX . Is there any keyword like MAX . If not, how can we create a column with the maximum size?

+19
source share
1 answer

If you want to create a "unlimited" varchar column, just use varchar with no length limit.

From the manual:

If a character variable is used without a length specifier, the type accepts strings of any size

So you can use:

 create table foo ( unlimited varchar ); 

Another alternative is to use text :

 create table foo ( unlimited text ); 

For more information on character data types, see the manual:
http://www.postgresql.org/docs/current/static/datatype-character.html

+25
source

Source: https://habr.com/ru/post/1245968/


All Articles