serious bug in "alter table tbname rename to newname"

From: jim(at)reptiles(dot)org (Jim Mercer)
To: pgsql-general(at)postgreSQL(dot)org
Cc: pgsql-general(at)postgreSQL(dot)org
Subject: serious bug in "alter table tbname rename to newname"
Date: 1999-04-29 14:51:07
Message-ID: m10cs9b-00080dC@mailbox.reptiles.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


============================================================================
POSTGRESQL BUG REPORT TEMPLATE
============================================================================

Your name : Jim Mercer
Your email address : jim(at)reptiles(dot)org

Category : runtime: back-end
Severity : critical

Summary: alter table tabname rename to newname does not rename extra files

System Configuration
--------------------
Operating System : FreeBSD 2.x/3.x

PostgreSQL version : 6.4 and 6.4.2

Compiler used : gcc

Hardware:
---------
Pentium 128M ram
FreeBSD bigbird.nag.ca 3.0-RELEASE FreeBSD 3.0-RELEASE #1: Tue Feb 2 22:50:41 EST 1999 root(at)bigbird(dot)nag(dot)ca:/usr/src/sys/compile/BIGBIRD i386

Versions of other tools:
------------------------

--------------------------------------------------------------------------

Problem Description:
--------------------
when a table exceeds 2gb, it appears that postgres will create subfiles for the data.
when you rename a table, the sub files do no get renamed.
see backend/commands/rename.c [renamerel()]

--------------------------------------------------------------------------

Test Case:
----------
create a table in excess of 2gig, which in turn creates subfiles
in data/base/tabname.
rename the table.
the subfiles are not renamed.

--------------------------------------------------------------------------

Solution:
---------
possible solution is to check if the table has subfiles, look for those subfiles and rename them as well.

--------------------------------------------------------------------------

--
[ Jim Mercer Reptilian Research jim(at)reptiles(dot)org +1 416 410-5633 ]
[ The telephone, for those of you who have forgotten, was a commonly used ]
[ communications technology in the days before electronic mail. ]
[ They're still easy to find in most large cities. -- Nathaniel Borenstein ]

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jun Zhang 1999-04-29 14:54:18 Re: [GENERAL] UnixWare chokes --- Resolution
Previous Message Herouth Maoz 1999-04-29 14:44:41 Re: [GENERAL] Any ideas why this doesn't work or how to rewrite it?