Обсуждение: Bug in pgadmin III v 1.12.2

Поиск
Список
Период
Сортировка

Bug in pgadmin III v 1.12.2

От
Dan S
Дата:
Hi !<br /><br />I'm running pgadmin v. 1.12.2 on winxp and postgres "PostgreSQL 9.0.2, compiled by Visual C++ build
1500,32-bit".<br /><br />When selecting a table in the tree-navigator to the left the table definition and its triggers
appearsto the right.<br /> However the trigger definition doesn't appear to be right ( a constraint trigger appears as
anordinary trigger ).<br /><br />To reproduce:<br /><br />create the table and trigger below then refresh the table
definitionin pgadmin and look at the trigger.<br /> It is not shown as a constraint trigger !<br /><br />create table
tst(txn_id int primary key, amount numeric(15,2));<br /><br />create or replace function
def_constr_tst_chk_balance()<br/>returns trigger as<br />$$<br />declare<br />    v_amount numeric(15,2);<br />
begin<br/>    if (tg_op='INSERT') then<br />        select sum(amount)<br />        into v_amount<br />        from
tst;<br/><br />        if (v_amount<>0) then<br />            raise exception 'error: sum does not balance';<br
/>        end if;<br />        return new;<br />    end if;<br />    raise exception 'only allowed to insert';<br
/>end;<br/>$$<br />language plpgsql;<br /><br />create constraint trigger tst_constraint<br />after insert or update or
delete<br/> on tst<br />deferrable initially deferred<br />for each row<br />execute procedure
def_constr_tst_chk_balance();<br/><br />-- should succeed on commit<br />begin transaction;<br />insert into tst
values(1,100);<br/>insert into tst values(2,-100);<br /> commit transaction;<br /><br />-- should fail on commit<br
/>begintransaction;<br />insert into tst values(3,100);<br />insert into tst values(4,-110);<br />commit
transaction;<br/><br /><br />Best Regards<br />Dan S<br /> 

Re: Bug in pgadmin III v 1.12.2

От
Guillaume Lelarge
Дата:
Le 13/03/2011 10:35, Dan S a écrit :
> 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 !
> 

Thanks for reporting this. It seems pgAdmin doesn't know anything about
constraint trigger. This is something we'll have to add in a future release.


-- 
Guillaumehttp://www.postgresql.frhttp://dalibo.com


Re: Bug in pgadmin III v 1.12.2

От
Guillaume Lelarge
Дата:
Le 13/03/2011 10:54, Guillaume Lelarge a écrit :
> Le 13/03/2011 10:35, Dan S a écrit :
>> 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 !
>>
> 
> Thanks for reporting this. It seems pgAdmin doesn't know anything about
> constraint trigger. This is something we'll have to add in a future release.
> 

FYI, I just pushed a patch that implements that. Will be available in
the next release of pgAdmin.

Thanks again for letting us know.


-- 
Guillaumehttp://www.postgresql.frhttp://dalibo.com


Re: Bug in pgadmin III v 1.12.2

От
Dan S
Дата:
Thanks  !
That will be nice to have !

Do you think the new release of pgAdmin will be ready and packaged when postgres 9.1 will be released ?

Best Regards
Dan

2011/3/24 Guillaume Lelarge <guillaume@lelarge.info>
Le 13/03/2011 10:54, Guillaume Lelarge a écrit :
> Le 13/03/2011 10:35, Dan S a écrit :
>> 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 !
>>
>
> Thanks for reporting this. It seems pgAdmin doesn't know anything about
> constraint trigger. This is something we'll have to add in a future release.
>

FYI, I just pushed a patch that implements that. Will be available in
the next release of pgAdmin.

Thanks again for letting us know.

Re: Bug in pgadmin III v 1.12.2

От
Guillaume Lelarge
Дата:
Le 25/03/2011 09:28, Dan S a écrit :
> Thanks  !
> That will be nice to have !
> 
> Do you think the new release of pgAdmin will be ready and packaged when
> postgres 9.1 will be released ?
> 

That's what we usually do, yes.


-- 
Guillaumehttp://www.postgresql.frhttp://dalibo.com