Sorting issue in table grid

From: Erwin Brandstetter <brandstetter(at)falter(dot)at>
To: pgadmin-hackers(at)postgresql(dot)org
Subject: Sorting issue in table grid
Date: 2007-10-17 21:01:59
Message-ID: 47167847.9040203@falter.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Hi developers! Hi Dave!

Testing the pgAdmin III 1.8.0 RC1 (Oct 9 2007, rev: 6725). Client Win
XP. Host: Debian Etch / PG 8.2.4

The phenomenon:
When applying a filter in the table grid, sorting stops to work sometimes.
I have seen this before, but could not reproduce it. This time I logged
the SQL statements and found the cause.

Explanation:
I work with varying filters to edit data in big tables. For this purpose
I sometimes comment out parts of the filter to reuse them later. Herein
lies the catch: pgadmin appends the "ORDER BY" clause without a newline,
so it gets commented out, if the filter ends with a comment.

Steps to reproduce:
Open edit grid on table foo, sort it by foo_id, and apply a filter:
foo_id > 5000
-- and foo <> 'sometxt'
The second (and last) line is commented out, for later use. pgAdmin
sends this query to the server:

SELECT * FROM foo WHERE foo_id > 5000
-- and foo <> 'sometxt' ORDER BY foo_id ASC

Fix:
Make sure there is a newline before appending the ORDER BY clause.

Regards
Erwin

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Guillaume Lelarge 2007-10-17 22:56:04 Re: translator: Russian
Previous Message Dave Page 2007-10-17 16:03:23 Re: Release schedule