[HACKERS] Varchar Vs. Text index matching - why different?

2003-03-20 Thread Philip Warner
I just noticed that comparing a text to a varchar results in an index not being used without a cast in some circumstances. Given that they have identical internal representations (or so I believe), that seems a little odd. Can anyone shed some light on this for me? I assume it has something to

Re: [HACKERS] Varchar Vs. Text index matching - why different?

2003-03-20 Thread Tom Lane
Philip Warner [EMAIL PROTECTED] writes: I just noticed that comparing a text to a varchar results in an index not being used without a cast in some circumstances. Given that they have identical internal representations (or so I believe), that seems a little odd. But they're not the same

Re: [HACKERS] Varchar Vs. Text index matching - why different?

2003-03-20 Thread Philip Warner
At 10:18 AM 20/03/2003 -0500, Tom Lane wrote: I have been wondering whether we couldn't eliminate the datatype distinction between text and varchar. That would be great if done magically in the backend. If all text columns were effectively wrapped in a Cast(X to text), life from a users PoV would

Re: [HACKERS] varchar vs. text

2001-07-11 Thread Jan Wieck
Ross J. Reedstrom wrote: On Wed, Jul 11, 2001 at 09:56:27AM -0400, Jan Wieck wrote: Rachit Siamwalla wrote: Is there any good reason to use VARCHAR over TEXT for a string field? ie. performance hits, etc. Other than running into the row size limit problem, are there any large

Re: [HACKERS] varchar vs. text

2001-07-11 Thread Rod Taylor
[EMAIL PROTECTED] To: Jan Wieck [EMAIL PROTECTED] Cc: Rachit Siamwalla [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Wednesday, July 11, 2001 10:56 AM Subject: Re: [HACKERS] varchar vs. text On Wed, Jul 11, 2001 at 09:56:27AM -0400, Jan Wieck wrote: Rachit Siamwalla wrote: Is there any good

Re: [HACKERS] varchar vs. text

2001-07-11 Thread Jan Wieck
Rachit Siamwalla wrote: Is there any good reason to use VARCHAR over TEXT for a string field? ie. performance hits, etc. Other than running into the row size limit problem, are there any large storage / performance penalties of using TEXT for virtually all strings? Er - what kind of

Re: [HACKERS] varchar vs. text

2001-07-11 Thread Ross J. Reedstrom
On Wed, Jul 11, 2001 at 09:56:27AM -0400, Jan Wieck wrote: Rachit Siamwalla wrote: Is there any good reason to use VARCHAR over TEXT for a string field? ie. performance hits, etc. Other than running into the row size limit problem, are there any large storage / performance penalties

[HACKERS] varchar vs. text

2001-07-10 Thread Rachit Siamwalla
Is there any good reason to use VARCHAR over TEXT for a string field? ie. performance hits, etc. Other than running into the row size limit problem, are there any large storage / performance penalties of using TEXT for virtually all strings? For ex. A phone number. This field probably wouldn't

Re: [HACKERS] varchar vs. text

2001-07-10 Thread Tom Lane
Rachit Siamwalla [EMAIL PROTECTED] writes: Is there any good reason to use VARCHAR over TEXT for a string field? The only reason to use VARCHAR is if you *want* the data to be truncated at a specific length. If you don't have a well-defined upper limit in mind, I'd recommend TEXT.