The following bug has been logged online:
Bug reference: 4083
Logged by: Pedro Gimeno
Email address: pgsql-001(at)personal(dot)formauri(dot)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.