Received: from news.tht.net (news.hub.org [216.126.91.242]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f9G4ZGP33666 for ; Tue, 16 Oct 2001 00:35:16 -0400 (EDT) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.4/8.11.4) id f9G4LWt78045 for pgsql-sql@postgresql.org; Tue, 16 Oct 2001 00:21:33 -0400 (EDT) (envelope-from news) From: "Frank Zhu" X-Newsgroups: comp.databases.postgresql.sql Subject: Re: VARCHAR vs TEXT Date: Tue, 16 Oct 2001 12:22:31 +0800 Organization: Hub.Org Networking Services (http://www.hub.org) Lines: 50 Message-ID: <9qgcka$2c6q$1@news.tht.net> References: <200110130354.f9D3sQH01372@candle.pha.pa.us> X-Complaints-To: scrappy@hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 To: pgsql-sql@postgresql.org X-Archive-Number: 200110/213 X-Sequence-Number: 5168 I want to store a long article in the Postgresql in Linux, how can I put the content into it and withdraw it back to show? urgent. Thanks. I use JSP. I note that all database systems are very dull in BLOB, but we need it to make a good system. At least, the documentation/faq should have much on it. thanks Frank Zhu. ======================== "Bruce Momjian" 写入消息新闻 :200110130354.f9D3sQH01372@candle.pha.pa.us... > > On Wed, 10 Oct 2001, Aasmund Midttun Godal wrote: > > > > > I am sure this question has been answered in some form or another > > > before, but I can't really find anything on exactly this issue. > > > > > > Are there any differences between varchar and text other than > > > > > > 1. varchar has limited size > > > 2. varchar is SQL 92 text is not? > > > > > > Especially regarding performance. > > > > > > Or am I correct to assume that if you need a place to store some text, > > > and you are not sure how much (like an email address or a name) you > > > are best off using text? > > > > Pretty much yes. text and varchar are pretty equivalent other than > > the fact that varchar specifies a maximum size. > > I have added the following paragraph to the FAQ: > >

CHAR() is best when storing strings that are usually the > same length. VARCHAR() is best when storing variable-length strings, > but you want to limit how long a string can be. TEXT is for strings > of unlimited length, maximum 1 gigabyte. BYTEA is for storing > binary data, particularly values that include NULL bytes.

> > -- > Bruce Momjian | http://candle.pha.pa.us > pgman@candle.pha.pa.us | (610) 853-3000 > + If your life is a hard drive, | 830 Blythe Avenue > + Christ can be your backup. | Drexel Hill, Pennsylvania 19026 > > ---------------------------(end of broadcast)--------------------------- > TIP 6: Have you searched our list archives? > > http://archives.postgresql.org