PSQL Data Type: text vs. varchar(n)

From: "kurt _" <kjs216(at)hotmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: PSQL Data Type: text vs. varchar(n)
Date: 2006-03-30 06:08:18
Message-ID: BAY104-F40CF00A633CE8B6C6A42FC88D10@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I am having a problem with Sun Java Studio Creator because the latest
version of the JDBC driver returns a field length of -1 for text fields.

My question: Is a text field just a varchar(Integer.MAX_VALUE)? If I want
to use the data binding part of the SJSC tool I will need to convert my text
fields to some standard SQL data type. I understand that varchar just
stores the actual length of the field, and not the padded white space.
Would anyone recommend for or against creating a field of
varchar(Integer.MAX_VALUE)? Will PostgreSQL choke on that? If against, how
is text implemented and how can I represent a variable-length String in a
SQL standard format?

Thanks.

_________________________________________________________________
Dont just search. Find. Check out the new MSN Search!
http://search.msn.click-url.com/go/onm00200636ave/direct/01/

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Aaron Glenn 2006-03-30 08:03:15 [Slightly OT] data model books/resources?
Previous Message Tom Lane 2006-03-30 03:10:46 Re: EXPLAIN SELECT .. does not return