Re: drop table and pg_proc

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: drop table and pg_proc
Date: 2001-01-12 05:12:14
Message-ID: 200101120512.AAA28193@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Add to TODO:

* Enforce referential integrity for system tables

> Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp> writes:
> > Suppose a function using table t1 as its argument:
> > create table t1(...
> > create fuction f1(t1) returns...
> > And if I drop t1 then do pg_dump, I would got something like:
> > failed sanity check, type with oid 1905168 was not found
> > This is because the type t1 does not exist anynmore. Since not being
> > able to make a back up of database is a critical problem, I think we
> > have to fix this.
>
> This is just one instance of the generic problem that we don't enforce
> referential integrity across system catalogs. Since this issue has
> always been there, I'm not inclined to panic about it (ie, I don't want
> to try to solve it for 7.1). But we should think about a long-term fix.
>
> > 1) remove that proc entry from pg_proc if t1 is deleted
> > 2) fix pg_dump so that it ignores sunch a bogus entry
> > 3) do both 1) and 2)
>
> Ultimately we should probably do both. #2 looks easier and is probably
> the thing to work on first. In general, pg_dump is fairly brittle when
> it comes to missing cross-references, eg, I think it fails to even
> notice a table that has no corresponding owner in pg_shadow (it should
> be doing an outer not inner join for that). It'd be worth fixing
> pg_dump so that it issues warnings about such cases but tries to plow
> ahead anyway.
>
> regards, tom lane
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2001-01-12 05:24:25 Re: postgresql.conf and postgres options
Previous Message Valter Mazzola 2001-01-12 04:21:03 Re: Pg7.1beta3: FATAL: s_lock(0x401f7010) at spin.c:147, stuck spinlock.