Re: [HACKERS] Re: [GENERAL] drop/rename table and transactions

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: Vadim Mikheev <vadim(at)krs(dot)ru>, Mike Mascari <mascarm(at)mascari(dot)com>, Lamar Owen <lamar(dot)owen(at)wgcr(dot)org>, Lincoln Yeoh <lylyeoh(at)mecomb(dot)com>, pgsql-general(at)postgreSQL(dot)org, PostgreSQL Developers List <hackers(at)postgreSQL(dot)org>
Subject: Re: [HACKERS] Re: [GENERAL] drop/rename table and transactions
Date: 1999-11-29 19:08:41
Message-ID: 199911291908.OAA29881@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

> > Wow, that is a major pain. Anyone else think so?
> > Using oid's instead of names may give us some ability to fix some other
> > bugs, though.
>
> Yes, and yes. I've been trying to nerve myself to propose that, because
> it seems the only reasonable way to make rollback of RENAME TABLE and
> DROP TABLE work safely. It'll be a pain in the neck for debugging and
> admin purposes though.

I look at this and question the value of allowing such fancy things vs.
the ability to look at the directory and know exactly what table is
which file. Maybe we can use file names like 23423_mytable where 24323
is the table oid and mytable is the table name. That way, we can know
the table, and they are unique too to allow RENAME TABLE to work.

This doesn't solve Vadim's problem. His additional work would be to
write a line to the log file for each table create/delete saying I
deleted this table with this oid, and when reading back the log, he has
to record the oid_username combination and use that to translate his log
oids into actual filenames.

In fact, doesn't that information already appear in the WAL log as part
of pg_class changes? Or is the problem that the table changes happen
before the pg_class is committed?

> Can we make some sort of usually-correct-but-not-guaranteed-correct
> dump that shows which corresponds to what? Maybe something similar
> to the textfile dump of pg_shadow that the postmaster uses for password
> authentication? Then at least you'd have some shot at figuring out
> which file was what in extremis...

That is OK, and a possible workaround if the above idea is not good.

--
Bruce Momjian | http://www.op.net/~candle
maillist(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-general by date

  From Date Subject
Next Message Bruce Momjian 1999-11-29 19:10:20 Re: [HACKERS] Re: [GENERAL] drop/rename table and transactions
Previous Message Herouth Maoz 1999-11-29 15:29:39 Re: [GENERAL] Quoting/Escaping

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1999-11-29 19:10:20 Re: [HACKERS] Re: [GENERAL] drop/rename table and transactions
Previous Message Massimo Dal Zotto 1999-11-29 17:47:08 Re: [HACKERS] How to get info about deadlocks?