Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Postgresql and pgAdmin III, what is character varying[]

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 []?

like image 527
Richard Avatar asked Jan 28 '14 18:01

Richard


People also ask

What is character varying [] in Postgres?

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.

What is TEXT [] in PostgreSQL?

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.

What is the difference between character and character varying in Postgres?

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.

What is default size of character varying 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.


2 Answers

This means postgresql array type that allows to store multiple values in a single table column. I.e. bigint[] means just array of bigint.

like image 175
Konstantin V. Salikhov Avatar answered Sep 20 '22 23:09

Konstantin V. Salikhov


As per this link Postgres Array Types

PostgreSQL allows columns of a table to be defined as variable-length multidimensional arrays.

like image 36
Krishnraj Rana Avatar answered Sep 17 '22 23:09

Krishnraj Rana