When creating a table in pgAdmin, there are two data types list for most entries, such as the following examples,
character varying, character varying[] or bigint, bigint[].
What is the significance of the data type followed by []?
PostgreSQL supports a character data type called VARCHAR. This data type is used to store characters of limited length. It is represented as varchar(n) in PostgreSQL, where n represents the limit of the length of the characters. If n is not specified it defaults to varchar which has unlimited length.
PostgreSQL supports a character data type called TEXT. This data type is used to store character of unlimited length. It is represented as text in PostgreSQL. The performance of the varchar (without n) and text are the same.
In PostgreSQL basically varying is the alias name of varchar, so there is only one difference between character varying and varchar is character varying more friendly than varchar in PostgreSQL.
It can store a string up to 65,535 bytes long. In the PostgreSQL Varchar data type i. e. Varchar(n), n is used to denote the character length limit. If n is not specified, it defaults to a character of infinite length.
This means postgresql array type that allows to store multiple values in a single table column. I.e. bigint[] means just array of bigint.
As per this link Postgres Array Types
PostgreSQL allows columns of a table to be defined as variable-length multidimensional arrays.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With