Обсуждение: CREATE CONSTRAINT TRIGGER in SQL pane (pgAdmin 1.14.1)

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

CREATE CONSTRAINT TRIGGER in SQL pane (pgAdmin 1.14.1)

От
Julius Tuskenis
Дата:
<div class="moz-signature"><font color="#000000">Hello,<br /><br /> After installing pgAdmin 1.14.1 I have noticed that
CREATECONSTRAINT TRIGGER statements are shown in SQL pane when selecting table from treeview. Is this done on
purpose?<br/> Frankly, I find no real use of statements like:<br /> CREATE CONSTRAINT TRIGGER
"RI_ConstraintTrigger_73501293"<br/>   AFTER DELETE<br />   ON b_dok<br />   FOR EACH ROW<br />   EXECUTE PROCEDURE
"RI_FKey_cascade_del"();<br/><br /> I think the  constraint triggers should not be shown (at least by default). They
mightbe a good thing for debugging but not for administrating the DB. I support the opinion stated in</font> <a
href="http://www.pgadmin.org/support/faq.php">http://www.pgadmin.org/support/faq.php</a>:<br /><font
color="#000000"><br/> "<span class="Apple-style-span" style="color: rgb(0, 0, 0);         font-family: verdana,
helvetica,sans-serif; font-size: 14px;         font-style: normal; font-variant: normal; font-weight: normal;
letter-spacing:normal; line-height: 17px; orphans: 2;         text-align: -webkit-auto; text-indent: 0px;
text-transform:        none; white-space: normal; widows: 2; word-spacing: 0px;         -webkit-text-size-adjust: auto;
-webkit-text-stroke-width:        0px; display: inline !important; float: none; "><br /> <...><br /> pgAdmin III
considersconstraint 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.
Sometools (e.g. pgAdmin II) imply this, by showing a ADD CONSTRAINT when reverse engineering, while actually the
constraintinformation in the database is missing.</span><br style="color: rgb(0, 0, 0); font-family:         verdana,
helvetica,sans-serif; font-size: 14px; font-style:         normal; font-variant: normal; font-weight: normal;
letter-spacing:normal; line-height: 17px; orphans: 2;         text-align: -webkit-auto; text-indent: 0px;
text-transform:        none; white-space: normal; widows: 2; word-spacing: 0px;         -webkit-text-size-adjust: auto;
-webkit-text-stroke-width:        0px; " /><span class="Apple-style-span" style="color: rgb(0, 0, 0);
font-family:verdana, helvetica, sans-serif; font-size: 14px;         font-style: normal; font-variant: normal;
font-weight:normal;         letter-spacing: normal; line-height: 17px; orphans: 2;         text-align: -webkit-auto;
text-indent:0px; text-transform:         none; white-space: normal; widows: 2; word-spacing: 0px;
-webkit-text-size-adjust:auto; -webkit-text-stroke-width:         0px; display: inline !important; float: none; ">Run
theadddepend script, which can be found in the backend's sources contrib/adddepend directory. [AP]</span>"<br /><br />
I'dbe glad if they disappeared from the SQL pane.</font><br /><font color="#000000"><br /> pgAdmin 1.14.1<br /> WinXp
SP3<br/> 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<br
/></font><br/> -- <br /> Julius Tuskenis<br /> Head of the programming department<br /> UAB nSoft<br /> mob.
+37068233050</div>

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

От
Guillaume Lelarge
Дата:
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.


-- 
Guillaume http://blog.guillaume.lelarge.info http://www.dalibo.com PostgreSQL Sessions #3:
http://www.postgresql-sessions.org



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

От
Guillaume Lelarge
Дата:
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



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

От
Miso Vanek
Дата:
On 2. Jan, 22:57 h., guilla...@lelarge.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...@postgresql.org)
> To make changes to your subscription:http://www.postgresql.org/mailpref/pgadmin-support

i have noticed it too.

Ubuntu 11.10
postgresql 9.1
pgadmin 1.14.1
compiled using gcc/g++, no additinional flags, only ./configure, make,
make install
rev: REL-1_14_1
show system objects - not enabled

example of SQL pane:

CREATE TABLE projects
( id serial NOT NULL, name text NOT NULL, handler text, CONSTRAINT projects_pkey PRIMARY KEY (id )
)
WITH ( OIDS=FALSE
);
ALTER TABLE projects OWNER TO smsgtwlive;

-- Trigger: RI_ConstraintTrigger_4601055 on projects

-- DROP TRIGGER "RI_ConstraintTrigger_4601055" ON projects;

CREATE CONSTRAINT TRIGGER "RI_ConstraintTrigger_4601055" AFTER DELETE ON projects FOR EACH ROW EXECUTE PROCEDURE
"RI_FKey_restrict_del"();

-- Trigger: RI_ConstraintTrigger_4601056 on projects

-- DROP TRIGGER "RI_ConstraintTrigger_4601056" ON projects;

CREATE CONSTRAINT TRIGGER "RI_ConstraintTrigger_4601056" AFTER UPDATE ON projects FOR EACH ROW EXECUTE PROCEDURE
"RI_FKey_restrict_upd"();


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

От
Miso Vanek
Дата:
On 2. Jan, 22:57 h., guilla...@lelarge.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...@postgresql.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.




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

От
Guillaume Lelarge
Дата:
On Wed, 2012-01-04 at 05:58 -0800, Miso Vanek wrote:
> On 2. Jan, 22:57 h., guilla...@lelarge.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...@postgresql.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.
> 

Yeah, I know what commit brings this issue because I did this commit.
This isn't my question.

The constraint trigger that appears in his pgadmin's window seems to be
the system trigger of a foreign key. This trigger shouldn't appear as it
is a system trigger. I created a trigger with a DELETE cascade, but I
don't see the system trigger, even with the "Show system objects"
checkbox checked. So, what I'm asking for is a test case showing the
issue.


-- 
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com
PostgreSQL Sessions #3: http://www.postgresql-sessions.org



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

От
Guillaume Lelarge
Дата:
On Wed, 2012-01-04 at 05:17 -0800, Miso Vanek wrote:
> On 2. Jan, 22:57 h., guilla...@lelarge.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...@postgresql.org)
> > To make changes to your subscription:http://www.postgresql.org/mailpref/pgadmin-support
> 
> i have noticed it too.
> 
> Ubuntu 11.10
> postgresql 9.1
> pgadmin 1.14.1
> compiled using gcc/g++, no additinional flags, only ./configure, make,
> make install
> rev: REL-1_14_1
> show system objects - not enabled
> 
> example of SQL pane:
> 
> CREATE TABLE projects
> (
>   id serial NOT NULL,
>   name text NOT NULL,
>   handler text,
>   CONSTRAINT projects_pkey PRIMARY KEY (id )
> )
> WITH (
>   OIDS=FALSE
> );
> ALTER TABLE projects
>   OWNER TO smsgtwlive;
> 
> -- Trigger: RI_ConstraintTrigger_4601055 on projects
> 
> -- DROP TRIGGER "RI_ConstraintTrigger_4601055" ON projects;
> 
> CREATE CONSTRAINT TRIGGER "RI_ConstraintTrigger_4601055"
>   AFTER DELETE
>   ON projects
>   FOR EACH ROW
>   EXECUTE PROCEDURE "RI_FKey_restrict_del"();
> 
> -- Trigger: RI_ConstraintTrigger_4601056 on projects
> 
> -- DROP TRIGGER "RI_ConstraintTrigger_4601056" ON projects;
> 
> CREATE CONSTRAINT TRIGGER "RI_ConstraintTrigger_4601056"
>   AFTER UPDATE
>   ON projects
>   FOR EACH ROW
>   EXECUTE PROCEDURE "RI_FKey_restrict_upd"();
> 

How did you create the table?


-- 
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com
PostgreSQL Sessions #3: http://www.postgresql-sessions.org



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

От
Guillaume Lelarge
Дата:
On Wed, 2012-01-04 at 15:46 +0100, Guillaume Lelarge wrote:
> On Wed, 2012-01-04 at 05:17 -0800, Miso Vanek wrote:
> > On 2. Jan, 22:57 h., guilla...@lelarge.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...@postgresql.org)
> > > To make changes to your subscription:http://www.postgresql.org/mailpref/pgadmin-support
> > 
> > i have noticed it too.
> > 
> > Ubuntu 11.10
> > postgresql 9.1
> > pgadmin 1.14.1
> > compiled using gcc/g++, no additinional flags, only ./configure, make,
> > make install
> > rev: REL-1_14_1
> > show system objects - not enabled
> > 
> > example of SQL pane:
> > 
> > CREATE TABLE projects
> > (
> >   id serial NOT NULL,
> >   name text NOT NULL,
> >   handler text,
> >   CONSTRAINT projects_pkey PRIMARY KEY (id )
> > )
> > WITH (
> >   OIDS=FALSE
> > );
> > ALTER TABLE projects
> >   OWNER TO smsgtwlive;
> > 
> > -- Trigger: RI_ConstraintTrigger_4601055 on projects
> > 
> > -- DROP TRIGGER "RI_ConstraintTrigger_4601055" ON projects;
> > 
> > CREATE CONSTRAINT TRIGGER "RI_ConstraintTrigger_4601055"
> >   AFTER DELETE
> >   ON projects
> >   FOR EACH ROW
> >   EXECUTE PROCEDURE "RI_FKey_restrict_del"();
> > 
> > -- Trigger: RI_ConstraintTrigger_4601056 on projects
> > 
> > -- DROP TRIGGER "RI_ConstraintTrigger_4601056" ON projects;
> > 
> > CREATE CONSTRAINT TRIGGER "RI_ConstraintTrigger_4601056"
> >   AFTER UPDATE
> >   ON projects
> >   FOR EACH ROW
> >   EXECUTE PROCEDURE "RI_FKey_restrict_upd"();
> > 
> 
> How did you create the table?
> 

OK, got it. I'm able to reproduce it on 8.3.


-- 
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com
PostgreSQL Sessions #3: http://www.postgresql-sessions.org



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

От
Julius Tuskenis
Дата:
On 2012.01.04 16:45, Guillaume Lelarge wrote:
> Yeah, I know what commit brings this issue because I did this commit.
> This isn't my question.
>
> The constraint trigger that appears in his pgadmin's window seems to be
> the system trigger of a foreign key. This trigger shouldn't appear as it
> is a system trigger. I created a trigger with a DELETE cascade, but I
> don't see the system trigger, even with the "Show system objects"
> checkbox checked. So, what I'm asking for is a test case showing the
> issue.
Sorry, Guillaume, for late responce.

What kind of test case can I provide? A database backup? A pgAdmin 
directory in a zip archive? A screenshot maybe?..

-- 
Julius Tuskenis
Head of the programming department
UAB nSoft
mob. +37068233050


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

От
Michal Vanek
Дата:


2012/1/4 Guillaume Lelarge <guillaume@lelarge.info>
On Wed, 2012-01-04 at 15:46 +0100, Guillaume Lelarge wrote:
> On Wed, 2012-01-04 at 05:17 -0800, Miso Vanek wrote:
> > On 2. Jan, 22:57 h., guilla...@lelarge.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...@postgresql.org)
> > > To make changes to your subscription:http://www.postgresql.org/mailpref/pgadmin-support
> >
> > i have noticed it too.
> >
> > Ubuntu 11.10
> > postgresql 9.1
> > pgadmin 1.14.1
> > compiled using gcc/g++, no additinional flags, only ./configure, make,
> > make install
> > rev: REL-1_14_1
> > show system objects - not enabled
> >
> > example of SQL pane:
> >
> > CREATE TABLE projects
> > (
> >   id serial NOT NULL,
> >   name text NOT NULL,
> >   handler text,
> >   CONSTRAINT projects_pkey PRIMARY KEY (id )
> > )
> > WITH (
> >   OIDS=FALSE
> > );
> > ALTER TABLE projects
> >   OWNER TO smsgtwlive;
> >
> > -- Trigger: RI_ConstraintTrigger_4601055 on projects
> >
> > -- DROP TRIGGER "RI_ConstraintTrigger_4601055" ON projects;
> >
> > CREATE CONSTRAINT TRIGGER "RI_ConstraintTrigger_4601055"
> >   AFTER DELETE
> >   ON projects
> >   FOR EACH ROW
> >   EXECUTE PROCEDURE "RI_FKey_restrict_del"();
> >
> > -- Trigger: RI_ConstraintTrigger_4601056 on projects
> >
> > -- DROP TRIGGER "RI_ConstraintTrigger_4601056" ON projects;
> >
> > CREATE CONSTRAINT TRIGGER "RI_ConstraintTrigger_4601056"
> >   AFTER UPDATE
> >   ON projects
> >   FOR EACH ROW
> >   EXECUTE PROCEDURE "RI_FKey_restrict_upd"();
> >
>
> How did you create the table?
>

OK, got it. I'm able to reproduce it on 8.3.

sorry, postgreSQL version is 8.4 not 9.1.
Table was created using this SQL query in pgadmin's query tool. id is foreign key in other tables.

CREATE TABLE projects
(
  id serial NOT NULL,
  name text NOT NULL,
  handler text,
  CONSTRAINT projects_pkey PRIMARY KEY (id )
)
WITH (
  OIDS=FALSE
);



--
Michal Vanek

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

От
Guillaume Lelarge
Дата:
On Wed, 2012-01-04 at 16:58 +0200, Julius Tuskenis wrote:
> On 2012.01.04 16:45, Guillaume Lelarge wrote:
> > Yeah, I know what commit brings this issue because I did this commit.
> > This isn't my question.
> >
> > The constraint trigger that appears in his pgadmin's window seems to be
> > the system trigger of a foreign key. This trigger shouldn't appear as it
> > is a system trigger. I created a trigger with a DELETE cascade, but I
> > don't see the system trigger, even with the "Show system objects"
> > checkbox checked. So, what I'm asking for is a test case showing the
> > issue.
> Sorry, Guillaume, for late responce.
> 

No problem.

> What kind of test case can I provide? A database backup? A pgAdmin 
> directory in a zip archive? A screenshot maybe?..
> 

No need because I have it now :) I'll try to work on this issue this
evening if my meeting doesn't last too much.


-- 
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com
PostgreSQL Sessions #3: http://www.postgresql-sessions.org



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

От
Guillaume Lelarge
Дата:
On Wed, 2012-01-04 at 16:17 +0100, Guillaume Lelarge wrote:
> On Wed, 2012-01-04 at 16:58 +0200, Julius Tuskenis wrote:
> > On 2012.01.04 16:45, Guillaume Lelarge wrote:
> > > Yeah, I know what commit brings this issue because I did this commit.
> > > This isn't my question.
> > >
> > > The constraint trigger that appears in his pgadmin's window seems to be
> > > the system trigger of a foreign key. This trigger shouldn't appear as it
> > > is a system trigger. I created a trigger with a DELETE cascade, but I
> > > don't see the system trigger, even with the "Show system objects"
> > > checkbox checked. So, what I'm asking for is a test case showing the
> > > issue.
> > Sorry, Guillaume, for late responce.
> > 
> 
> No problem.
> 
> > What kind of test case can I provide? A database backup? A pgAdmin 
> > directory in a zip archive? A screenshot maybe?..
> > 
> 
> No need because I have it now :) I'll try to work on this issue this
> evening if my meeting doesn't last too much.
> 

It should be fixed now. Will be available with 1.14.2.

Thanks for the report.


-- 
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com
PostgreSQL Sessions #3: http://www.postgresql-sessions.org



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

От
Guillaume Lelarge
Дата:
On Wed, 2012-01-04 at 16:04 +0100, Michal Vanek wrote:
> 
> 
> 2012/1/4 Guillaume Lelarge <guillaume@lelarge.info>
>         On Wed, 2012-01-04 at 15:46 +0100, Guillaume Lelarge wrote:
>         > On Wed, 2012-01-04 at 05:17 -0800, Miso Vanek wrote:
>         > > On 2. Jan, 22:57 h., guilla...@lelarge.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...@postgresql.org)
>         > > > To make changes to your
>         subscription:http://www.postgresql.org/mailpref/pgadmin-support
>         > >
>         > > i have noticed it too.
>         > >
>         > > Ubuntu 11.10
>         > > postgresql 9.1
>         > > pgadmin 1.14.1
>         > > compiled using gcc/g++, no additinional flags,
>         only ./configure, make,
>         > > make install
>         > > rev: REL-1_14_1
>         > > show system objects - not enabled
>         > >
>         > > example of SQL pane:
>         > >
>         > > CREATE TABLE projects
>         > > (
>         > >   id serial NOT NULL,
>         > >   name text NOT NULL,
>         > >   handler text,
>         > >   CONSTRAINT projects_pkey PRIMARY KEY (id )
>         > > )
>         > > WITH (
>         > >   OIDS=FALSE
>         > > );
>         > > ALTER TABLE projects
>         > >   OWNER TO smsgtwlive;
>         > >
>         > > -- Trigger: RI_ConstraintTrigger_4601055 on projects
>         > >
>         > > -- DROP TRIGGER "RI_ConstraintTrigger_4601055" ON
>         projects;
>         > >
>         > > CREATE CONSTRAINT TRIGGER "RI_ConstraintTrigger_4601055"
>         > >   AFTER DELETE
>         > >   ON projects
>         > >   FOR EACH ROW
>         > >   EXECUTE PROCEDURE "RI_FKey_restrict_del"();
>         > >
>         > > -- Trigger: RI_ConstraintTrigger_4601056 on projects
>         > >
>         > > -- DROP TRIGGER "RI_ConstraintTrigger_4601056" ON
>         projects;
>         > >
>         > > CREATE CONSTRAINT TRIGGER "RI_ConstraintTrigger_4601056"
>         > >   AFTER UPDATE
>         > >   ON projects
>         > >   FOR EACH ROW
>         > >   EXECUTE PROCEDURE "RI_FKey_restrict_upd"();
>         > >
>         >
>         > How did you create the table?
>         >
>         
>         
>         OK, got it. I'm able to reproduce it on 8.3.
>         
>         
>         --
>         Guillaume
>         http://blog.guillaume.lelarge.info
>         http://www.dalibo.com
>         PostgreSQL Sessions #3: http://www.postgresql-sessions.org
>         
>         
> 
> sorry, postgreSQL version is 8.4 not 9.1.

Yeah, no problem, I made the mistake too.

I commited a patch a few minutes ago. Thanks for your help.


-- 
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com
PostgreSQL Sessions #3: http://www.postgresql-sessions.org