Re: Bug with view definitions?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Justin Clift <jc(at)telstra(dot)net>
Cc: PostgreSQL Hackers Mailing List <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Bug with view definitions?
Date: 2004-07-02 03:35:04
Message-ID: 8944.1088739304@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Justin Clift <jc(at)telstra(dot)net> writes:
> Tom Lane wrote:
>> Actually, if you look at the source code (information_schema.sql) there
>> is no ORDER BY in it, only a DISTINCT. The ORDER BY gets added by the
>> parser to help implement the DISTINCT. Sooner or later we should look
>> at suppressing the added ORDER BY when displaying the view.

> If someone fixes this can we make sure it goes into 7.4.4 as well (if
> it's not a drastic code change)?

The thoughts I had for fixing it involved adding a field to SortClause
nodes to show whether they came from an actual user clause or were added
by the parser. This would be an initdb-forcing change and thus
unsuitable for a backpatch to 7.4 ...

> It's not a data corrupting bug but it's stopping view definitions from
> "working as advertised" which is bad if you're used to being able to
> rely on them. :-/

No, the pretty-printer's failure to add parens here is a different bug.
That we could fix without a data structure change. It's just a matter
of figuring out exactly where it's being too permissive about dropping
parens.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Christopher Kings-Lynne 2004-07-02 03:36:34 Re: Bug with view definitions?
Previous Message Christopher Kings-Lynne 2004-07-02 03:06:44 compile errors in new PL/Pler