Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Novice > Re: Disadvantag...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 5 of 15 Topic 3107 of 3323
Post > Topic >>

Re: Disadvantages to using "text"

by ashaw@[EMAIL PROTECTED] (Aurynn Shaw) May 7, 2008 at 10:02 AM

> Are there any reasons for not using the “text” type whenever a variable 
> length string field is needed?  Are there penalties in disk usage, 
> memory usage or performance?
> 
>  
> 
> What are the differences between declaring something “varchar” or 
> “varchar(n)” or “text”?  (I realize that the middle one has an upper 
> limit while the others do not.)

Actually, no, there's no reason to use varchar over text, unless you are 
wanting to explicitly limit the input length of your data.

Internally, Postgres treats a VARCHAR(n) as a TEXT with a CHECK 
constraint applied to it, so VARCHAR is going to be slightly slower to
use.

Hope that helps,
Aurynn.

-- 
Aurynn Shaw

The PostgreSQL Company - Command Prompt, Inc. 1.503.667.4564 ext 103
PostgreSQL Replication, Consulting, Custom Development, 24x7 sup****t

ashaw@[EMAIL PROTECTED]
 
Sent via pgsql-novice mailing list (pgsql-novice@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-novice
 




 15 Posts in Topic:
Disadvantages to using "text"
dmies@[EMAIL PROTECTED]   2008-05-07 08:52:27 
Re: Disadvantages to using "text"
rdeleonp@[EMAIL PROTECTED  2008-05-07 11:01:09 
Re: Disadvantages to using "text"
richard.broersma@[EMAIL P  2008-05-07 09:03:57 
Re: Disadvantages to using "text"
tgl@[EMAIL PROTECTED] (T  2008-05-07 12:09:27 
Re: Disadvantages to using "text"
ashaw@[EMAIL PROTECTED]   2008-05-07 10:02:10 
Re: Disadvantages to using "text"
brucejhyatt@[EMAIL PROTEC  2008-05-07 09:44:10 
Re: Disadvantages to using "text"
tgl@[EMAIL PROTECTED] (T  2008-05-07 12:54:51 
Re: Disadvantages to using "text"
brucejhyatt@[EMAIL PROTEC  2008-05-07 18:40:52 
Re: Disadvantages to using "text"
fbax@[EMAIL PROTECTED] (  2008-05-07 12:55:14 
Re: Disadvantages to using "text"
gcocks@[EMAIL PROTECTED]   2008-05-07 11:48:02 
Re: Disadvantages to using "text"
robe.dnd@[EMAIL PROTECTED  2008-05-07 15:15:08 
Re: Disadvantages to using "text"
gcocks@[EMAIL PROTECTED]   2008-05-13 10:58:26 
Re: Disadvantages to using "text"
ktuszynska@[EMAIL PROTECT  2008-05-13 10:04:08 
Re: Disadvantages to using "text" [ArcGIS]
gcocks@[EMAIL PROTECTED]   2008-05-13 11:26:43 
Re: Disadvantages to using "text"
ashaw@[EMAIL PROTECTED]   2008-05-07 13:19:47 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Dec 5 6:32:01 CST 2008.