New regress test (was Re: Timespan_div misbehaving?)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
Cc: hackers(at)postgreSQL(dot)org
Subject: New regress test (was Re: Timespan_div misbehaving?)
Date: 1999-03-26 15:23:32
Message-ID: 23577.922461812@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us> wrote a couple weeks ago:
> Tom, would you please take the pg/include/catalog/*.sql files and merge
> them into the regression sanity checks? They should be in there too.
> You can remove them once you have moved them over.

I made some progress on this last night, but still need to work on the
other test file from include/catalog/.

There is a new regress test "oidjoins" that checks consistency of all
OID and REGPROC columns in the standard tables. Basically it looks
for dangling links --- values that do not match any OID in the target
table that the column is supposed to link to. The test script can be
rebuilt, if the set of columns to check changes, by running the code
in contrib/findoidjoins. (I thought about just running findoidjoins
as part of the regress test, but it seems unreasonably slow for that.
Also, you really want to eyeball findoidjoins' output before using it,
since the proggie will be misled by OIDs that join to the wrong table.)

I found a dozen or so bogus tuples in several system tables (mostly
pg_amop and pg_aggregate IIRC). They had OID entries that referred
to OIDs that actually exist ... but are in the wrong table. For
example some of the amopclaid fields had values that were OIDs of
procs or types instead of opclass rows. I believe these are leftovers
from some ancient time when those OIDs were being used for something
else. (Most of the current assignments of those OIDs have to do with
int8, so I know they are relatively new. Evidently no one ran an
oidjoins check while the OIDs were unused...)

All of the tuples in question were either unused or else referenced
only by other bogus tuples, so I just deleted 'em. (I'm new to
adding/removing entries in system tables; is there anything else that
needs to be done besides editing include/catalog/pg_*.h?)

Note the oidjoins test will fail until you do an initdb, because of
the aforementioned bogus tuples.

regards, tom lane

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Lockhart 1999-03-26 15:30:23 Re: [HACKERS] Associative Operators? (Was: Re: [NOVICE] Out of frying pan, into fire)
Previous Message The Hermit Hacker 1999-03-26 02:31:01 Re: [HACKERS] PostgreSQL LOGO (was: Developers Globe (FINAL))