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

From: "Pedro Gimeno" <pgsql-001(at)personal(dot)formauri(dot)es>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #4083: Return type of MAX and MIN of a VARCHAR column is TEXT
Date: 2008-04-01 16:39:16
Message-ID: 200804011639.m31GdGCx042756@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


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.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Heikki Linnakangas 2008-04-01 17:53:43 Re: BUG #4082: Fatal error, close server
Previous Message MARCO A GONZALEZ 2008-04-01 16:27:50 BUG #4082: Fatal error, close server