From: Daniel Migowski <dmigowski@ikoffice.de>
To: Gregory Stark <stark@enterprisedb.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: TypeInfoCache
Date: Wed, 19 Dec 2007 19:17:46 +0100
Message-ID: <4769604A.9050006@ikoffice.de> (raw)
In-Reply-To: <873atymzpu.fsf@oxford.xeocode.com>
References: <47692DEB.9070307@ikoffice.de>
<877ijan2cp.fsf@oxford.xeocode.com>
<47693B10.3040804@ikoffice.de>
<873atymzpu.fsf@oxford.xeocode.com>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Gregory Stark schrieb:
<blockquote cite="mid:873atymzpu.fsf@oxford.xeocode.com" type="cite">
<pre wrap="">"Daniel Migowski" <a class="moz-txt-link-rfc2396E" href="mailto:dmigowski@ikoffice.de"><dmigowski@ikoffice.de></a> writes:
</pre>
<blockquote type="cite">
<blockquote type="cite">
<pre wrap="">Why?
</pre>
</blockquote>
<pre wrap="">Because VARCHAR (in my understanding) has some limit, like 256 or 50 or even
8192, whatever.
</pre>
</blockquote>
<pre wrap="">
yes, 2GB, same as text.
</pre>
</blockquote>
I meant the limit you give it. Not the internal one. VARCHAR(50) has a
limit of 50, right?
<blockquote cite="mid:873atymzpu.fsf@oxford.xeocode.com" type="cite">
<blockquote type="cite">
<pre wrap="">LONGVARCHAR is unlimited as I understand and much better
matches what i understood what "text" is for.
</pre>
</blockquote>
<pre wrap="">
Well you haven't explained what you understand "text" is for but in Postgres
they can be used pretty much interchangeably.
</pre>
</blockquote>
I think a VARCHAR(50) and text are not interchangeable.<br>
<blockquote cite="mid:873atymzpu.fsf@oxford.xeocode.com" type="cite">
<pre wrap="">
I think this has come up before, you should check the mail archives. The
problem is that describing "text" as if it's not a simple varchar type of type
confuses other applications into restricting what you can do with it. They
assume it has the kind of restrictions other databases impose.
</pre>
</blockquote>
Which restrictions does an JDBC-LONGVARCHAR impose? Read the JDBC spec,
please, where they say they are interchangeable reagrding all Access
methods? Like in PostgreSQL. But a LONGVARCHAR is IMHO commonly
regarded as "very much text", while a VARCHAR(n) is regarded as "up to
n chars" of text.<br>
<blockquote cite="mid:873atymzpu.fsf@oxford.xeocode.com" type="cite">
<pre wrap="">Generally in Postgres you're probably best off using "text" unless you have
some specific limit you need to impose. In most cases Postgres will silently
cast your varchars to text when necessary but every now and then you might
find a case where it doesn't and fails to use an index or optimize a query
where it could.
</pre>
</blockquote>
This one is new to me. Does this mean even storage is done the same for
text and varchar? Does this mean I could savely convert all my
varchar's to text (if my client application accepts this?)<br>
<br>
With best regards,<br>
Daniel Migowski<br>
<br>
PS: Now searching the archives...<br>
<br>
<div class="moz-signature">-- <br>
<pre> |¯¯|¯¯| <b>IKOffice GmbH Daniel Migowski</b>
| | |/| Mail: <a
href="mailto:dmigowski@ikoffice.de">dmigowski@ikoffice.de</a>
| | // | Nordstr. 10 Tel.: +49 (441) 21 98 89 52
| | \\ | 26135 Oldenburg Fax.: +49 (441) 21 98 89 55
|__|__|\| <a href="http://www.ikoffice.de">http://www.ikoffice.de</a; Mob.: +49 (176) 22 31 20 76
Geschäftsführer: Ingo Kuhlmann, Daniel Migowski
Amtsgericht Oldenburg, HRB 201467
Steuernummer: 64/211/01864</pre>
</div>
</body>
</html>
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: dmigowski@ikoffice.de, stark@enterprisedb.com
Subject: Re: TypeInfoCache
In-Reply-To: <4769604A.9050006@ikoffice.de>
References: <47692DEB.9070307@ikoffice.de> <877ijan2cp.fsf@oxford.xeocode.com> <47693B10.3040804@ikoffice.de> <873atymzpu.fsf@oxford.xeocode.com> <4769604A.9050006@ikoffice.de>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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