Re: BUG #3598: Strange behaviour of character columns in select with views - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #3598: Strange behaviour of character columns in select with views
Date
Msg-id 29142.1189100514@sss.pgh.pa.us
Whole thread Raw
In response to BUG #3598: Strange behaviour of character columns in select with views  ("Luiz K. Matsumura" <luiz@planit.com.br>)
List pgsql-bugs
"Luiz K. Matsumura" <luiz@planit.com.br> 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

pgsql-bugs by date:

Previous
From: "Jayaram R"
Date:
Subject: BUG #3603: ADO PostgreSQL OLE DB Provider ERROR
Next
From: Simon Riggs
Date:
Subject: Re: create index concurrently blocks on transactions in other databases