BUG #4083: Return type of MAX and MIN of a VARCHAR column is TEXT - Mailing list pgsql-bugs

From Pedro Gimeno
Subject BUG #4083: Return type of MAX and MIN of a VARCHAR column is TEXT
Date
Msg-id 200804011639.m31GdGCx042756@wwwmaster.postgresql.org
Whole thread Raw
Responses Re: BUG #4083: Return type of MAX and MIN of a VARCHAR column is TEXT  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
The following bug has been logged online:

Bug reference:      4083
Logged by:          Pedro Gimeno
Email address:      pgsql-001@personal.formauri.es
PostgreSQL version: 8.2.5
Operating system:   Irrelevant
Description:        Return type of MAX and MIN of a VARCHAR column is TEXT
Details:

Example:

CREATE TABLE a (x VARCHAR(40));

INSERT INTO a (x) VALUES ("blah");

SELECT MAX(x),MIN(x) FROM a;

The last query's return types are both TEXT, which in Zeos are not treated
in the same way as varchar.

Since the queries are designed to work with multiple servers, the only
workaround we've found so far is to create aggregate functions MAX(varchar)
and MIN(varchar) that return varchar.

pgsql-bugs by date:

Previous
From: "MARCO A GONZALEZ"
Date:
Subject: BUG #4082: Fatal error, close server
Next
From: Heikki Linnakangas
Date:
Subject: Re: BUG #4082: Fatal error, close server