dbTalk Databases Forums  

character(n) size

comp.databases.postgresql comp.databases.postgresql


Discuss character(n) size in the comp.databases.postgresql forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
bcar
 
Posts: n/a

Default character(n) size - 10-01-2010 , 04:03 AM






Hi,

In the postgres documentation we can read that space used by short
string (<126 bytes) = 1 byte + size of the string.
And longer string = 4 byte + size of the string

I understand that for character varying(n) or character varying, but for
a character(n) is it really the same things ?

Because a character(4) already used 4 bytes (it already completed with
blanck space). So why specify the space in each string if we know it

Reply With Quote
  #2  
Old   
Jasen Betts
 
Posts: n/a

Default Re: character(n) size - 10-02-2010 , 04:08 AM






On 2010-10-01, bcar <bcar44 (AT) laposte (DOT) net> wrote:
Quote:
Hi,

In the postgres documentation we can read that space used by short
string (<126 bytes) = 1 byte + size of the string.
And longer string = 4 byte + size of the string

I understand that for character varying(n) or character varying, but for
a character(n) is it really the same things ?

Because a character(4) already used 4 bytes (it already completed with
blanck space). So why specify the space in each string if we know it
charcter(4) is is not always 4 bytes.

eg: '𥐯𥐰𥒲𥕞' which is 4 characters takes takes 16 bytes for the
character data (and (I guess) 1 byte for the length ).

Read the page on character data types for more info.
http://www.postgresql.org/docs/9.0/i...character.html

--
¡spuɐɥ ou 'ɐꟽ ʞooꞀ

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.