Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-hackers by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group