Re: pg_dump issue : Cannot drop a non-existent(?) trigger

From: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
To: Devrim GUNDUZ <devrim(at)gunduz(dot)org>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_dump issue : Cannot drop a non-existent(?) trigger
Date: 2005-03-25 14:02:09
Message-ID: 20050325055728.A98363@megazone.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, 25 Mar 2005, Devrim GUNDUZ wrote:

> - --------------------------------------------------------------------------------------------------------------
> PostgreSQL 8.0.1 on i686-redhat-linux-gnu, compiled by GCC gcc (GCC)
> 3.2.3 20030502 (Red Hat Linux 3.2.3-42)
> =======================================================================
>
> We wanted to take a full backup, so ran pg_dump,but got an error:
>
> =======================================================================
> $ pg_dump prod -U postgres > all.pgdump
> pg_dump: invalid argument string (firma_moduller_firma_fkey1) for trigger
> "RI_ConstraintTrigger_39053" on table "t_firma_moduller"
> =======================================================================
>
> Looking at the details, we saw the trigger there:
>
> =======================================================================
> prod=# \d t_firma_moduller
> Table
> "public.t_firma_moduller"
> Column | Type |
> Modifiers
> - ------------------+-----------------------------+--------------------------------------------------------------------------
> firma_no | character varying(10) | not null
> modul_adi | character varying(20) | not null
> last_update_date | timestamp without time zone |
> last_update_user | character varying(45) |
> kod | integer | not null default
> fn_get_seq_value('t_firma_moduller'::character varying)
> Indexes:
> "t_firma_moduller_pkey" PRIMARY KEY, btree (firma_no, modul_adi)
> "t_firma_moduller_kodu_ukey" UNIQUE, btree (kod)
> Triggers:
> "RI_ConstraintTrigger_39053" AFTER INSERT OR UPDATE ON
> t_firma_moduller FROM t_firmalar NOT DEFERRABLE INITIALLY IMMEDIATE FOR
> EACH ROW EXECUTE PROCEDURE
> "RI_FKey_check_ins"('firma_moduller_firma_fkey1', 't_firma_moduller',
> 't_firmalar', 'UNSPECIFIED', 'firma_no', 'no')

Odd, why is this not showing up as a foreign key constraint? Has this
database been upgraded (no matter through how many different upgrades)
from an old version (7.1 or earlier I think)?

> prod=# DROP TRIGGER RI_ConstraintTrigger_39053 ON t_firma_moduller;
> ERROR: trigger "ri_constrainttrigger_39053" for table "t_firma_moduller"
> does not exist

You'd need to quote the trigger name because it's mixed case.

> Is this a bug or something? There should not be a trigger there.

Well, it really should be showing up as something like:
CONSTRAINT firma_moduller_firma_fkey1 FOREIGN KEY (firma_no)
REFERENCES t_firmalar(no)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2005-03-25 14:53:38 Re: Patch for collation using ICU
Previous Message Palle Girgensohn 2005-03-25 13:22:51 Re: Patch for collation using ICU