pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Field Size
5+ messages / 5 participants
[nested] [flat]

* Field Size
@ 2003-12-08 12:52  Ganesan Kanavathy <ganesh@epedas.com.my>
  0 siblings, 0 replies; 5+ messages in thread

From: Ganesan Kanavathy @ 2003-12-08 12:52 UTC (permalink / raw)
  To: pgsql-sql; pgsql-admin@postgresql.org

Can anyone tell me, what harm would setting a field size to 1000
characters do to the size?
 
By increasing the size, will the database require more space? Or does it
only consume space if there is data in the field only?
 
Regards,
Ganesan
 

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Field Size
@ 2003-12-08 12:56  Ganesan Kanavathy <ganesh@magnusquest.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Ganesan Kanavathy @ 2003-12-08 12:56 UTC (permalink / raw)
  To: pgsql-sql; pgsql-admin@postgresql.org

Can anyone tell me, what harm would setting a field size to 1000
characters do to the size?
 
By increasing the size, will the database require more space? Or does it
only consume space if there is data in the field only?
 
Regards,
Ganesan
 

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Field Size
@ 2003-12-08 13:03  Marc A. Leith <marc@redboxdata.com>
  parent: Ganesan Kanavathy <ganesh@magnusquest.com>
  0 siblings, 0 replies; 5+ messages in thread

From: Marc A. Leith @ 2003-12-08 13:03 UTC (permalink / raw)
  To: Ganesan Kanavathy <ganesh@magnusquest.com>; pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>; pgsql-sql

If you define the field as CHAR, 1000 bytes will be consumed.

If you define the field as VARCHAR, on sufficient bytes to store the contents will be used.

Marc

--Original Message Text---
From: Ganesan Kanavathy
Date: Mon, 8 Dec 2003 20:56:06 +0800

Clean Clean DocumentEmail MicrosoftInternetExplorer4 /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-
colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-
orphan; font-size:10.0pt; font-family:"Times New Roman";} 

Can anyone tell me, what harm would setting a field size to 1000 characters do to the size?  

   

By increasing the size, will the database require more space? Or does it only consume space if there is data in the field only?  

   

Regards,  

Ganesan  

   




Marc A. Leith
President
redboxdata inc.

e-mail: marc@redboxdata.com
cell:    (416) 737 0045

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Field Size
@ 2003-12-08 13:06  Somasekhar Bangalore <sbangalore@zensutra.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Somasekhar Bangalore @ 2003-12-08 13:06 UTC (permalink / raw)
  To: Ganesan Kanavathy <ganesh@magnusquest.com>; pgsql-sql; pgsql-admin@postgresql.org

There is no harm in having a field size of 1000 character provided u use the proper datatype. Don't user char(1000). Try using varchar(1000).
 
For character data it is recommended to use the VARCHAR type, since PostgreSQL manages it very well.  On the contrary, if you use the CHAR datatype, the size you specify for the string is pre-allocated in the pages and you allocate space which may not be used.  So your database is bigger than what it should be and performance is lowered, because this way you need more I/O to read the data.
 
Som
 
-----Original Message-----
From: Ganesan Kanavathy [mailto:ganesh@magnusquest.com]
Sent: Monday, December 08, 2003 6:26 PM
To: pgsql-sql@postgresql.org; pgsql-admin@postgresql.org
Subject: Re: [ADMIN] Field Size
 
Can anyone tell me, what harm would setting a field size to 1000 characters do to the size?
 
By increasing the size, will the database require more space? Or does it only consume space if there is data in the field only?
 
Regards,
Ganesan
 

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Field Size
@ 2003-12-08 15:35  Bruno Wolff III <bruno@wolff.to>
  parent: Somasekhar Bangalore <sbangalore@zensutra.com>
  0 siblings, 0 replies; 5+ messages in thread

From: Bruno Wolff III @ 2003-12-08 15:35 UTC (permalink / raw)
  To: Somasekhar Bangalore <sbangalore@zensutra.com>; +Cc: Ganesan Kanavathy <ganesh@magnusquest.com>; pgsql-sql; pgsql-admin@postgresql.org

On Mon, Dec 08, 2003 at 18:36:57 +0530,
  Somasekhar Bangalore <sbangalore@zensutra.com> wrote:
> There is no harm in having a field size of 1000 character provided u use the proper datatype. Don't user char(1000). Try using varchar(1000).

And if the 1000 limit is just a large number you picked rather than a
real rule for your data, then you probably want to use the TEXT type.



^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2003-12-08 15:35 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-12-08 12:52 Field Size Ganesan Kanavathy <ganesh@epedas.com.my>
2003-12-08 12:56 Re: Field Size Ganesan Kanavathy <ganesh@magnusquest.com>
2003-12-08 13:03 ` Marc A. Leith <marc@redboxdata.com>
2003-12-08 13:06 Re: Field Size Somasekhar Bangalore <sbangalore@zensutra.com>
2003-12-08 15:35 ` Bruno Wolff III <bruno@wolff.to>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox