在PostgreSQL RDS上创建表空间 [英] Create tablespace on PostgreSQL RDS
问题描述
我是Amazon RDS的新手.我正在尝试创建应用程序的表空间,但是找不到应该在哪里存储它.
I am new on Amazon RDS. I'm trying to create the tablespaces of my application, but I can't find where I should store it.
是否可以在PostgreSQL RDS上创建表空间?
Is it possible to create tablespaces on PostgreSQL RDS?
推荐答案
我没有找到有关此的RDS文档,但是显然Postgres表空间可以在RDS上正常工作.您没有直接访问RDS使用的基础EBS卷的权限,但是如果您尝试使用某个任意目录的CREATE TABLESPACE命令:
I didn't find RDS documentation about this, but apparently Postgres tablespaces work fine on RDS. You don't have direct access to the underlying EBS volume that RDS is using, but if you try a CREATE TABLESPACE command with some arbitrary directory:
CREATE TABLESPACE测试空间位置'/foo/bar/baz';
您可以看到表空间的创建是这样的:mydb =>\D b表空间列表姓名|业主|位置
------------ + ------------ + -------------------------------------------pg_default |rdsadmin |pg_global |rdsadmin |测试空间|db_user |/rdsdbdata/db/base/tablespace/foo/bar/baz(3列)
You can see that the tablespace gets created like so:
mydb=> \db
List of tablespaces
Name | Owner | Location
------------+------------+-------------------------------------------
pg_default | rdsadmin |
pg_global | rdsadmin |
testspace | db_user | /rdsdbdata/db/base/tablespace/foo/bar/baz
(3 rows)
您应该能够在该表空间中创建表:mydb =>CREATE TABLE test(int)TABLESPACE测试空间;创建表
And you should be able to create tables in that tablespace just fine:
mydb=> CREATE TABLE test (a int) TABLESPACE testspace ;
CREATE TABLE
这篇关于在PostgreSQL RDS上创建表空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!