Bug in pgadmin III v 1.12.2

From: Dan S <strd911(at)gmail(dot)com>
To: pgadmin-support(at)postgresql(dot)org
Subject: Bug in pgadmin III v 1.12.2
Date: 2011-03-13 09:35:42
Message-ID: AANLkTinbujGBqqtBh3v55p3OJJHQ91Nneb552B7ZJ7UJ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support

Hi !

I'm running pgadmin v. 1.12.2 on winxp and postgres "PostgreSQL 9.0.2,
compiled by Visual C++ build 1500, 32-bit".

When selecting a table in the tree-navigator to the left the table
definition and its triggers appears to the right.
However the trigger definition doesn't appear to be right ( a constraint
trigger appears as an ordinary trigger ).

To reproduce:

create the table and trigger below then refresh the table definition in
pgadmin and look at the trigger.
It is not shown as a constraint trigger !

create table tst (txn_id int primary key, amount numeric(15,2));

create or replace function def_constr_tst_chk_balance()
returns trigger as
$$
declare
v_amount numeric(15,2);
begin
if (tg_op='INSERT') then
select sum(amount)
into v_amount
from tst;

if (v_amount<>0) then
raise exception 'error: sum does not balance';
end if;
return new;
end if;
raise exception 'only allowed to insert';
end;
$$
language plpgsql;

create constraint trigger tst_constraint
after insert or update or delete
on tst
deferrable initially deferred
for each row
execute procedure def_constr_tst_chk_balance();

-- should succeed on commit
begin transaction;
insert into tst values(1,100);
insert into tst values(2,-100);
commit transaction;

-- should fail on commit
begin transaction;
insert into tst values(3,100);
insert into tst values(4,-110);
commit transaction;

Best Regards
Dan S

Responses

Browse pgadmin-support by date

  From Date Subject
Next Message Guillaume Lelarge 2011-03-13 09:54:47 Re: Bug in pgadmin III v 1.12.2
Previous Message Vladimir Kokovic 2011-03-12 15:19:54 Re: Git Makefile.am