Обсуждение: BUG #4083: Return type of MAX and MIN of a VARCHAR column is TEXT
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.
"Pedro Gimeno" <pgsql-001@personal.formauri.es> writes: > Description: Return type of MAX and MIN of a VARCHAR column is TEXT This is not a bug. Most if not all operations with varchar will return text --- it doesn't have its own operators. > The last query's return types are both TEXT, which in Zeos are not treated > in the same way as varchar. I think you need to file a bug with Zeos to fix whatever their problem is with text. regards, tom lane
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.