バージョンごとのドキュメント一覧

ALTER TABLESPACE

ALTER TABLESPACE <refpurpose>change the definition of a tablespace</refpurpose> — テーブル空間の定義を変更する

概要

ALTER TABLESPACE name RENAME TO new_name
ALTER TABLESPACE name OWNER TO { new_owner | CURRENT_ROLE | CURRENT_USER | SESSION_USER }
ALTER TABLESPACE name SET ( tablespace_option = value [, ... ] )
ALTER TABLESPACE name RESET ( tablespace_option [, ... ] )

説明

<title>Description</title>

<command>ALTER TABLESPACE</command> can be used to change the definition of a tablespace. ALTER TABLESPACEはテーブル空間の定義を変更するのに使うことができます。

You must own the tablespace to change the definition of a tablespace. To alter the owner, you must also be able to <literal>SET ROLE</literal> to the new owning role. (Note that superusers have these privileges automatically.) テーブル空間の定義を変更するにはテーブル空間の所有者でなければなりません。 所有者を変更するには、新しい所有者ロールに対してSET ROLEもできなければなりません。 (スーパーユーザがこれらの権限を自動的に持つことに注意してください。)

パラメータ

<title>Parameters</title>
name

The name of an existing tablespace. 既存のテーブル空間の名前です。

new_name

The new name of the tablespace. The new name cannot begin with <literal>pg_</literal>, as such names are reserved for system tablespaces. テーブル空間の新しい名前です。 pg_から始まる名前は、システムのテーブル空間用に予約されているため使用することができません。

new_owner

The new owner of the tablespace. テーブル空間の新しい所有者です。

tablespace_option

A tablespace parameter to be set or reset. Currently, the only available parameters are <varname>seq_page_cost</varname>, <varname>random_page_cost</varname>, <varname>effective_io_concurrency</varname> and <varname>maintenance_io_concurrency</varname>. Setting these values for a particular tablespace will override the planner's usual estimate of the cost of reading pages from tables in that tablespace, and how many concurrent I/Os are issued, as established by the configuration parameters of the same name (see <xref linkend="guc-seq-page-cost"/>, <xref linkend="guc-random-page-cost"/>, <xref linkend="guc-effective-io-concurrency"/>, <xref linkend="guc-maintenance-io-concurrency"/>). This may be useful if one tablespace is located on a disk which is faster or slower than the remainder of the I/O subsystem. 値を設定あるいはリセットするテーブル空間のパラメータです。 現在、利用可能なパラメータはseq_page_costrandom_page_costeffective_io_concurrencymaintenance_io_concurrencyのみです。 特定のテーブル空間について、この値を設定すると、プランナがそのテーブル空間内のテーブルからページを読み込むコストの通常の推定値や、発行される同時I/Oの数について、通常参照する同じ名前の設定パラメータ(seq_page_costrandom_page_costeffective_io_concurrencymaintenance_io_concurrencyを参照)よりも優先します。 テーブル空間が、他のI/Oサブシステムより高速あるいは低速なディスク上にある時は、これが有用でしょう。

<title>Examples</title>

Rename tablespace <literal>index_space</literal> to <literal>fast_raid</literal>: テーブル空間index_spacefast_raidという名前に変更します。

ALTER TABLESPACE index_space RENAME TO fast_raid;

Change the owner of tablespace <literal>index_space</literal>: テーブル空間index_spaceの所有者を変更します。

ALTER TABLESPACE index_space OWNER TO mary;

互換性

<title>Compatibility</title>

There is no <command>ALTER TABLESPACE</command> statement in the SQL standard. 標準SQLにはALTER TABLESPACE文はありません。

関連項目

<title>See Also</title> CREATE TABLESPACE, DROP TABLESPACE