Thread: Trigger Refresh Error - PGAdmin

Trigger Refresh Error - PGAdmin

From
"Hart, Rob (FWP)"
Date:
<div class="WordSection1"><p class="MsoNormal">Hello,<p class="MsoNormal">I’m not sure whether this is a PGAdmin bug or
otherwisebut I was able to replicate on different servers, though I haven’t tested it in other versions of pgadmin.<p
class="MsoNormal"> <pclass="MsoNormal"> <p class="MsoNormal">PG Admin v1.14.3<p class="MsoNormal">"PostgreSQL 9.1.4 on
x86_64-unknown-linux-gnu,compiled by gcc (SUSE Linux) 4.3.4 [gcc-4_3-branch revision 152973], 64-bit"<p
class="MsoNormal">SLES11 SP2<p class="MsoNormal"> <p class="MsoNormal">To create error:<p class="MsoNormal">Right click
ontrigger object and select refresh.<p class="MsoNormal"> <p class="MsoNormal"><img height="283" id="Picture_x0020_2"
src="cid:image001.png@01CD8200.2BCB0A30"width="534" /><p class="MsoNormal"> <p class="MsoNormal"><b>Error details taken
fromlog:</b><p class="MsoNormal"> <p class="MsoNormal">pgdev pgAdmin III - BrowserERROR:  syntax error at or near "AND"
atcharacter 527<p class="MsoNormal">pgdev pgAdmin III - BrowserSTATEMENT:  SELECT t.oid, t.xmin, t.*, relname, CASE
WHENr<p class="MsoNormal">elkind = 'r' THEN TRUE ELSE FALSE END AS parentistable,   nspname, des.description,
l.lanname,p.prosrc,<p class="MsoNormal">          substring(pg_get_triggerdef(t.oid), 'WHEN (.*) EXECUTE PROCEDURE') AS
whenclause<pclass="MsoNormal">          FROM pg_trigger t<p class="MsoNormal">          JOIN pg_class cl ON
cl.oid=tgrelid<pclass="MsoNormal">          JOIN pg_namespace na ON na.oid=relnamespace<p class="MsoNormal"> 
        LEFTOUTER JOIN pg_description des ON des.objoid=t.oid<p class="MsoNormal">          LEFT OUTER JOIN pg_proc p
ONp.oid=t.tgfoid<p class="MsoNormal">          LEFT OUTER JOIN pg_language l ON l.oid=p.prolang<p
class="MsoNormal">        WHERE NOT tgisinternal AND<p class="MsoNormal"> <p class="MsoNormal">           AND
t.tgname='ces_contact_audit'AND cl.oid=17731::oid AND cl.relnamespace=17441::oid::oid<p class="MsoNormal">        
ORDERBY tgname<p class="MsoNormal"> <p class="MsoNormal">Please let me know if you require any further details.<p
class="MsoNormal">KindRegards,<p class="MsoNormal">Robert Hart<p class="MsoNormal"> </div> 

Re: Trigger Refresh Error - PGAdmin

From
Guillaume Lelarge
Date:
On Fri, 2012-08-24 at 20:04 +0000, Hart, Rob (FWP) wrote:
> Hello,
> I'm not sure whether this is a PGAdmin bug or otherwise but I was able to replicate on different servers, though I
haven'ttested it in other versions of pgadmin.
 
> 
> 
> PG Admin v1.14.3
> "PostgreSQL 9.1.4 on x86_64-unknown-linux-gnu, compiled by gcc (SUSE Linux) 4.3.4 [gcc-4_3-branch revision 152973],
64-bit"
> SLES 11 SP2
> 
> To create error:
> Right click on trigger object and select refresh.
> 
> [cid:image001.png@01CD8200.2BCB0A30]
> 
> Error details taken from log:
> 
> pgdev pgAdmin III - BrowserERROR:  syntax error at or near "AND" at character 527
> pgdev pgAdmin III - BrowserSTATEMENT:  SELECT t.oid, t.xmin, t.*, relname, CASE WHEN r
> elkind = 'r' THEN TRUE ELSE FALSE END AS parentistable,   nspname, des.description, l.lanname, p.prosrc,
>           substring(pg_get_triggerdef(t.oid), 'WHEN (.*) EXECUTE PROCEDURE') AS whenclause
>           FROM pg_trigger t
>           JOIN pg_class cl ON cl.oid=tgrelid
>           JOIN pg_namespace na ON na.oid=relnamespace
>           LEFT OUTER JOIN pg_description des ON des.objoid=t.oid
>           LEFT OUTER JOIN pg_proc p ON p.oid=t.tgfoid
>           LEFT OUTER JOIN pg_language l ON l.oid=p.prolang
>          WHERE NOT tgisinternal AND
> 
>            AND t.tgname='ces_contact_audit' AND cl.oid=17731::oid AND cl.relnamespace=17441::oid::oid
>          ORDER BY tgname
> 
> Please let me know if you require any further details.

This is a pgAdmin's bug for sure. It's now fixed (in 1.16 and in the dev
branch).

Thanks for your report.


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