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

Re: error auto-completing "GRANT SELECT ON"

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Dave Page <dpage(at)postgresql(dot)org>
Cc: Alejandro Gasca <galejadror(at)gmail(dot)com>, pgAdmin Support <pgadmin-support(at)postgresql(dot)org>
Subject: Re: error auto-completing "GRANT SELECT ON"
Date: 2007-10-31 09:57:54
Message-ID: 472851A2.2010409@hagander.net (view raw or flat)
Thread:
Lists: pgadmin-support
Dave Page wrote:
> Alejandro Gasca wrote:
>> Hi, if i open a sql pane, and put:
>> GRANT SELECT ON
>> and press [ctrl]+[space] this error rise:
>>
>> ERROR: syntax error at or near "DATABASE"
>> LINE 6: UNION SELECT "DATABASE" UNION SELECT "FUNCTION" UNION S...
> 
> Magnus - can you take a look at this please. I'm not overly familiar
> with your code and would rather not break it...
> 
> It seems that _complete_from_query() (in tabcomplete.c) is calling
> PQescapeString() on the addon param which is doubling the existing
> quotes around the unioned bits of the query (ie. SELECT 'DATABASE'). As
> far as I can see all this does is break cases like the one Alejandro has
> reported. Have I missed any other cases?

Fixed. It was supposed to only PQescapeString() on normal queries, but
did it on schema queries as well.

Bug has been there since tab completion was added :-)

//Magnus

In response to

pgadmin-support by date

Next:From: zoranDate: 2007-10-31 15:04:49
Subject: Not able to add or remove argument in Parameters tab, Function Properties
Previous:From: Laurent ROCHEDate: 2007-10-31 00:17:27
Subject: generating UPDATE SET ... WHERE PK = ...

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