Обсуждение: Triggers?

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

Triggers?

От
Raymond O'Donnell
Дата:
Hi all,

I'm currently updating an old database that started life in PG 7.3, and 
it has a bunch of triggers for foreign key constraints, named 
"RI_ConstraintTrigger_XXXXX" and the like.

While replacing these with "proper" foreign keys, I noticed that they 
don't show up in PgAdmin under the table's "Triggers" node. They do, 
however, appear in PHPPgAdmin and in psql.

I'm using PgAdmin 1.8.0. Am I missing something? Or should I just 
upgrade to 1.8.1?

TIA,

Ray.


---------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod@iol.ie
---------------------------------------------------------------


Re: Triggers?

От
"Dave Page"
Дата:
On Jan 31, 2008 5:38 PM, Raymond O'Donnell <rod@iol.ie> wrote:
> Hi all,
>
> I'm currently updating an old database that started life in PG 7.3, and
> it has a bunch of triggers for foreign key constraints, named
> "RI_ConstraintTrigger_XXXXX" and the like.
>
> While replacing these with "proper" foreign keys, I noticed that they
> don't show up in PgAdmin under the table's "Triggers" node. They do,
> however, appear in PHPPgAdmin and in psql.
>
> I'm using PgAdmin 1.8.0. Am I missing something? Or should I just
> upgrade to 1.8.1?

HI Ray,

iirc, in 7.4 and some of the other 8.x versions there was a contrib
module call adddepends which was basically a perl script which added
the required dependency information to turn the old style foreign keys
into new style. I think it's now worked it's way onto pgFoundry.

Regards, Dave


Re: Triggers?

От
Raymond O'Donnell
Дата:
On 31/01/2008 19:19, Dave Page wrote:

> iirc, in 7.4 and some of the other 8.x versions there was a contrib
> module call adddepends which was basically a perl script which added
> the required dependency information to turn the old style foreign keys
> into new style. I think it's now worked it's way onto pgFoundry.

Hi Dave,

Thanks for that - I may look it up, as it would help with what I'm 
currently doing - though admittedly I don't have a huge amount to do.

However, what puzzled me is why the triggers appear in psql and 
PHPPgAdmin but not in PgAdmin (they don't show up as foreign keys under 
the "Constraints" node either).

Ray.


---------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod@iol.ie
---------------------------------------------------------------


Re: Triggers?

От
"Dave Page"
Дата:
On Jan 31, 2008 8:21 PM, Raymond O'Donnell <rod@iol.ie> wrote:

> However, what puzzled me is why the triggers appear in psql and
> PHPPgAdmin but not in PgAdmin (they don't show up as foreign keys under
> the "Constraints" node either).

pgAdmin will hide RI constraint triggers, but it detects foreign keys
based on the dependency information (which you use adddepends to add
to an old DB) and the triggers. Older versions of pgAdmin (ie. pgAdmin
I & II), and presumably phpPgAdmin recognise the foreign keys from the
triggers used and ignore the dependency information. In theory that
can mean misidentifying triggers as RI constraints, though in reality
that's pretty unlikely.

/D