Text Type

From: "Paul Skinner" <skin(at)skin(dot)dhs(dot)org>
To: <pgsql-docs(at)postgresql(dot)org>
Subject: Text Type
Date: 2001-01-23 02:58:47
Message-ID: 001e01c084e8$69015cf0$03320a0a@skinz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

Character Types
SQL defines two primary character types: character and character varying. Postgres supports these types, in addition to the more general text type, which unlike character varying does not require an explicit declared upper limit on the size of the field.

Table 3-4. Postgres Character Types

Character Type Storage Recommendation Description
character(n), char(n) (4+n) bytes SQL-compatible Fixed-length blank padded
character varying(n), varchar(n) (4+n) bytes SQL-compatible Variable-length with limit
text (4+n) bytes Most flexible Variable unlimited length

-----------------------

Text type is not unlimited but rather limited by tuple size of 8140 bytes.

Paul

Browse pgsql-docs by date

  From Date Subject
Next Message Jeff Duffy 2001-01-23 04:44:21 Error in Programmer's Guide: JDBC
Previous Message Tom Lane 2001-01-23 02:41:31 DOS-ish newlines are infecting our SGML files