Re: Weird behaviour with ALTER TABLE ... SET TABLESPACE ... statement

From: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Weird behaviour with ALTER TABLE ... SET TABLESPACE ... statement
Date: 2008-10-07 12:34:08
Message-ID: 48EB5740.5030204@lelarge.info
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Heikki Linnakangas a écrit :
> Tom Lane wrote:
>> Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com> writes:
>>> Yeah, seems like we need to allocate a new relfilenode in the new
>>> tablespace.
>>
>> I looked into tablecmds.c and verified that ATExecSetTableSpace doesn't
>> worry about selecting a new relfilenode. I'm also noticing a number of
>> permissions-type checks that seem like they'd better be done in
>> ATPrepSetTableSpace, because we don't go through ATExecSetTableSpace
>> if the table requires rewriting for other reasons.
>
> The same tests are performed in the rewriting code path in
> ATRewriteTables() and in heap_create_with_catalog().
>
> I fixed the relfilenode allocation in 8.1-HEAD. Doesn't seem worth
> fixing in 8.0, because GetNewRelFileNode() didn't exist before 8.1, so
> we couldn't check for collisions anyway.
>

Thanks. It works great!

--
Guillaume.
http://www.postgresqlfr.org
http://dalibo.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2008-10-07 12:50:38 Re: Subtransaction commits and Hot Standby
Previous Message Andrew Dunstan 2008-10-07 12:30:57 Re: Reducing some DDL Locks to ShareLock