Re: CREATE CONSTRAINT TRIGGER in SQL pane (pgAdmin 1.14.1)

From: Miso Vanek <michal(dot)vanek(at)gmail(dot)com>
To: pgadmin-support(at)postgresql(dot)org
Subject: Re: CREATE CONSTRAINT TRIGGER in SQL pane (pgAdmin 1.14.1)
Date: 2012-01-04 13:58:54
Message-ID: e2e1eacc-8dc3-4e2f-8f37-4efe7f8f236e@o14g2000vbo.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support

On 2. Jan, 22:57 h., guilla(dot)(dot)(dot)(at)lelarge(dot)info (Guillaume Lelarge) wrote:
> On Mon, 2011-12-19 at 10:50 +0100, Guillaume Lelarge wrote:
> > On Thu, 2011-12-15 at 15:39 +0200, Julius Tuskenis wrote:
> > > Hello,
>
> > > After installing pgAdmin 1.14.1 I have noticed that CREATE CONSTRAINT
> > > TRIGGER statements are shown in SQL pane when selecting table from
> > > treeview. Is this done on purpose?
> > > Frankly, I find no real use of statements like:
> > > CREATE CONSTRAINT TRIGGER "RI_ConstraintTrigger_73501293"
> > >    AFTER DELETE
> > >    ON b_dok
> > >    FOR EACH ROW
> > >    EXECUTE PROCEDURE "RI_FKey_cascade_del"();
>
> > > I think the  constraint triggers should not be shown (at least by
> > > default). They might be a good thing for debugging but not for
> > > administrating the DB. I support the opinion stated in
> > >http://www.pgadmin.org/support/faq.php:
>
> > > "
> > > <...>
> > > pgAdmin III considers constraint triggers as an internal implementation
> > > detail, not interesting for the common administrator. In fact, CREATE
> > > CONSTRAINT TRIGGER is for backward compatibility only, and shouldn't be
> > > used in newer scripts any more. Some tools (e.g. pgAdmin II) imply this,
> > > by showing a ADD CONSTRAINT when reverse engineering, while actually the
> > > constraint information in the database is missing.
> > > Run the adddepend script, which can be found in the backend's sources
> > > contrib/adddepend directory. [AP]"
>
> > > I'd be glad if they disappeared from the SQL pane.
>
> > > pgAdmin 1.14.1
> > > WinXp SP3
> > > PostgreSQL 8.3.4 on i686-pc-linux-gnu, compiled by GCC gcc (Gentoo
> > > 4.3.2-r3 p1.6, pie-10.1.5) 4.3.2
>
> > System constraints triggers shouldn't appear at all if you didn't select
> > the "Show system objects". They never should appear in the SQL pane of a
> > table description for example.
>
> > User constraints triggers should always appear.
>
> > The fact that system constraint triggers appear wasn't done on purpose.
> > As a matter of fact, this is a bug.
>
> I tried to make it appear many times, but failed. Do you have
> self-contained test case that I could use? Thanks.
>
> --
> Guillaume
>  http://blog.guillaume.lelarge.info
>  http://www.dalibo.com
>   PostgreSQL Sessions #3:http://www.postgresql-sessions.org
>
> --
> Sent via pgadmin-support mailing list (pgadmin-supp(dot)(dot)(dot)(at)postgresql(dot)org)
> To make changes to your subscription:http://www.postgresql.org/mailpref/pgadmin-support

This is the problem:

http://git.postgresql.org/gitweb/?p=pgadmin3.git;a=commitdiff;h=b41f071c9642f41896693be4e29f55409d8cd9ce

- trig_sql += wxT("NOT tgisconstraint\n");
+ trig_sql += wxT("1=1 \n");

After changing it to
trig_sql += wxT("NOT tgisconstraint\n");
it seems to be ok.

In response to

Responses

Browse pgadmin-support by date

  From Date Subject
Next Message Raymond O'Donnell 2012-01-04 14:25:51 Re:
Previous Message Miso Vanek 2012-01-04 13:17:26 Re: CREATE CONSTRAINT TRIGGER in SQL pane (pgAdmin 1.14.1)