Online Documentation Server
 ПОИСК
ods.com.ua Web
 КАТЕГОРИИ
Home
Programming
Net technology
Unixes
Security
RFC, HOWTO
Web technology
Data bases
Other docs

 


 ПОДПИСКА

 О КОПИРАЙТАХ
Вся предоставленная на этом сервере информация собрана нами из разных источников. Если Вам кажется, что публикация каких-то документов нарушает чьи-либо авторские права, сообщите нам об этом.




Character Types

Character Types

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

Table 3-5. Postgres Character Types

Character TypeStorageRecommendationDescription
char1 byteSQL92-compatibleSingle character
char(n)(4+n) bytesSQL92-compatibleFixed-length blank padded
text(4+x) bytesBest choiceVariable-length
varchar(n)(4+n) bytesSQL92-compatibleVariable-length with limit

There is one other fixed-length character type in Postgres. The name type only has one purpose and that is for storage of internal catalog names. It is not intended for use by the general user. Its length is currently defined as 32 bytes (31 characters plus terminator) but should be reference using NAMEDATALEN. The length is set at compile time (and is therefore adjustable for special uses); the default maximum length may change in a future release.

Table 3-6. Postgres Specialty Character Type

Character TypeStorageDescription
name32 bytesThirty-one character internal type



With any suggestions or questions please feel free to contact us