--- src/ui/dlgTrigger.cpp.orig Wed Oct 1 04:01:27 2003 +++ src/ui/dlgTrigger.cpp Wed Oct 1 04:02:13 2003 @@ -173,7 +173,7 @@ { pgObject *obj=pgTrigger::ReadObjects(collection, 0, wxT("\n AND tgname=") + qtString(GetName()) + - wxT("\n AND tgreloid=") + table->GetOidStr() + + wxT("\n AND tgrelid=") + table->GetOidStr() + wxT("\n AND relnamespace=") + table->GetSchema()->GetOidStr()); return obj; } --- src/schema/pgTrigger.cpp.orig Wed Oct 1 04:06:20 2003 +++ src/schema/pgTrigger.cpp Wed Oct 1 04:09:23 2003 @@ -169,14 +169,19 @@ { pgTrigger *trigger=0; - pgSet *triggers= collection->GetDatabase()->ExecuteSet( - wxT("SELECT t.oid, t.*, relname, nspname, des.description\n") + wxString trig_sql; + trig_sql = wxT("SELECT t.oid, t.*, relname, nspname, des.description\n") wxT(" FROM pg_trigger t\n") wxT(" JOIN pg_class cl ON cl.oid=tgrelid\n") wxT(" JOIN pg_namespace na ON na.oid=relnamespace\n") wxT(" LEFT OUTER JOIN pg_description des ON des.objoid=t.oid\n") - wxT(" WHERE NOT tgisconstraint AND tgrelid = ") + collection->GetOidStr() + wxT("\n") - wxT(" ORDER BY tgname")); + wxT(" WHERE NOT tgisconstraint \n"); + if (restriction.IsEmpty()) + trig_sql += wxT(" AND tgrelid = ") + collection->GetOidStr() + wxT("\n"); + else + trig_sql += restriction + wxT("\n"); + trig_sql += wxT(" ORDER BY tgname"); + pgSet *triggers= collection->GetDatabase()->ExecuteSet(trig_sql); if (triggers) {