"Luiz K. Matsumura" <[EMAIL PROTECTED]> writes: > Description: Strange behaviour of character columns in select with > views
I've applied a fix for this in CVS HEAD (8.3-to-be), but it seems impractical to fix it in 8.2 (or 8.1 which also has the issue). The problem is that when "null::char(3)" is simplified to a bare Const expression node, the length knowledge is lost because there is no place to store typmod in pre-8.3 Const nodes. The peculiar-seeming dependence on the form of the query is because the behavior depends on exactly which version of the select list (before or after const simplification) is looked at to generate the typmod value that ultimately gets sent to the client. While it might be possible to find a hack that improves the behavior for specific cases in 8.2 (by changing around when we look at what), the fundamental lack of the needed field in Const nodes is unfixable without forcing initdb, which we won't do in released branches. So I'm not excited about looking for a band-aid answer for 8.2 or 8.1. regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 2: Don't 'kill -9' the postmaster