Re: BUG #4083: Return type of MAX and MIN of a VARCHAR column is TEXT

From: Pedro Gimeno <pgsql-002(at)personal(dot)formauri(dot)es>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #4083: Return type of MAX and MIN of a VARCHAR column is TEXT
Date: 2008-04-02 09:14:56
Message-ID: 47F34E90.9040509@personal.formauri.es
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Peter Eisentraut wrote:

> Tom Lane wrote:
> > I think you need to file a bug with Zeos to fix whatever their
> > problem is with text.
>
> Well, to be fair, type text is not SQL standard. But surely Zeos
> won't get very far with this superstrict typing approach. At least a
> little bit more context might help us understand.

Sure. Zeos allows connection to multiple servers, not just PostgreSQL;
for example, Firebird, MySQL and MSSQL.

Zeos (as well as the Borland Database Engine, which it just mimics in
this sense) assumes that VARCHAR fields in general (not just
PostgreSQL's) are textual fields with a limit of 255 characters for all
supported servers, which are graphically associated with single-line
edit controls.

On the other side, Zeos (as BDE did before as well as others) recognizes
that many servers have mechanisms for allowing fields with texts longer
than 255 characters and adds support for them; for example in Firebird
the type is BLOB SUB_TYPE TEXT and in MySQL it's TEXT. It assumes that
PostgreSQL's TEXT type falls into that category and associates it with a
"large text" type rather than "short text". The support for them is
quite limited, as they are a kind of "largest common divisor" of the
capabilities of the supported servers.

I think, but I'm not sure, that even the ODBC standard makes such
distinction between short and large text fields.

BTW, of course Tom is right in that most operators return TEXT and not
VARCHAR; I just stumbled upon this problem in a query that used MAX().

-- Pedro Gimeno

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Premysl Paska 2008-04-02 11:10:16 BUG #4084: Some DST timezones switche to summer time (one week) later
Previous Message NikhilS 2008-04-02 07:23:27 Re: Problem identifying constraints which should not be inherited