Unix Technical Forum

ALTER TABLE SET TABLESPACE and pg_toast

This is a discussion on ALTER TABLE SET TABLESPACE and pg_toast within the Pgsql Performance forums, part of the PostgreSQL category; --> We're storing tif images in a table as bytea. We were running low on our primary space and moved ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql Performance

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-19-2008, 06:48 AM
PostgreSQL
 
Posts: n/a
Default ALTER TABLE SET TABLESPACE and pg_toast

We're storing tif images in a table as bytea. We were running low on our
primary space and moved several tables, including the one with the images,
to a second tablespace using ALTER TABLE SET TABLESPACE.
This moved quite cleaned out quite a bit of space on the original
tablespace, but not as much as it should have. It does not appear that the
corresponding pg_toast tables were moved. So, my questions are:

1) Is there a way to move pg_toast tables to new tablespaces (or at least
assure that new ones are created there)?
2) Also, is there a good way to determine which pg_toast tables are
associated with any particular table and column?

Thank you for your help,
Martin


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-19-2008, 06:48 AM
Tom Lane
 
Posts: n/a
Default Re: ALTER TABLE SET TABLESPACE and pg_toast

"PostgreSQL" <martin@portant.com> writes:
> We're storing tif images in a table as bytea. We were running low on our
> primary space and moved several tables, including the one with the images,
> to a second tablespace using ALTER TABLE SET TABLESPACE.
> This moved quite cleaned out quite a bit of space on the original
> tablespace, but not as much as it should have. It does not appear that the
> corresponding pg_toast tables were moved.


I think you're mistaken; at least, the SET TABLESPACE code certainly
intends to move a table's toast table and index along with the table.
What's your evidence for saying it didn't happen, and which PG version
are you using exactly?

> 2) Also, is there a good way to determine which pg_toast tables are
> associated with any particular table and column?


pg_class.reltoastrelid and reltoastidxid. See
http://www.postgresql.org/docs/8.1/static/storage.html
http://www.postgresql.org/docs/8.1/s...-pg-class.html

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 10:20 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com