Thread: Graphical Query Builder bug

Graphical Query Builder bug

From
Bartosz Dmytrak
Date:
Hi All
Today I decided to build a query using Query Builder functionality of pgAdmin, so I switched to Graphical Query Builder tab and did some clicking  Few seconds later I received something like this:

SELECT 
  jpga_servergroups.groupid, 
  jpga_servergroups.groupname, 
  jpga_servergroups.caption
FROM 
  "MyShema".jpga_servergroups
WHERE 
  jpga_servergroups.rolid = 1
ORDER BY
  jpga_servergroups.groupname ASC;

What was fine. Then I noticed there is a long table name before each column, so I decided to add alias for a table. I switched again to GQB, I added alias and problem appeared. SQL generated was like this one:

SELECT 
  s.groupid, 
  s.groupname, 
  s.caption
FROM 
  "MyShema".jpga_servergroups s
WHERE 
  jpga_servergroups.rolid = 1
ORDER BY
  s.groupname ASC;

WHERE condition wasn't updated, so it is not a correct statement.

env:
pgAdmin III 1.16.0
Mandriva Linux 64 bit


regards,
Bartek

Re: Graphical Query Builder bug

From
Guillaume Lelarge
Date:
On Thu, 2012-09-13 at 22:09 +0200, Bartosz Dmytrak wrote:
> Hi All
> Today I decided to build a query using Query Builder functionality of
> pgAdmin, so I switched to Graphical Query Builder tab and did
> some clicking  Few seconds later I received something like this:
> 
> SELECT
>   jpga_servergroups.groupid,
>   jpga_servergroups.groupname,
>   jpga_servergroups.caption
> FROM
>   "MyShema".jpga_servergroups
> WHERE
>   jpga_servergroups.rolid = 1
> ORDER BY
>   jpga_servergroups.groupname ASC;
> 
> What was fine. Then I noticed there is a long table name before each
> column, so I decided to add alias for a table. I switched again to GQB, I
> added alias and problem appeared. SQL generated was like this one:
> 
> SELECT
>   s.groupid,
>   s.groupname,
>   s.caption
> FROM
>   "MyShema".jpga_servergroups s
> WHERE
>   *jpga_servergroups.rolid = 1*
> ORDER BY
>   s.groupname ASC;
> 
> WHERE condition wasn't updated, so it is not a correct statement.
> 
> env:
> pgAdmin III 1.16.0
> Mandriva Linux 64 bit
> 

I reproduce this. I added a ticket to work on it later.


-- 
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com