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

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

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. All in all this
code seems to need more careful review than it's gotten so far.
You want to do it?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2008-10-06 13:07:05 Re: Add default_val to pg_settings
Previous Message Heikki Linnakangas 2008-10-06 12:38:02 Re: Weird behaviour with ALTER TABLE ... SET TABLESPACE ... statement