⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tablespace.source

📁 PostgreSQL 8.1.4的源码 适用于Linux下的开源数据库系统
💻 SOURCE
字号:
-- create a tablespace we can useCREATE TABLESPACE testspace LOCATION '@testtablespace@';-- create a schema we can useCREATE SCHEMA testschema;-- try a tableCREATE TABLE testschema.foo (i int) TABLESPACE testspace;SELECT relname, spcname FROM pg_catalog.pg_tablespace t, pg_catalog.pg_class c    where c.reltablespace = t.oid AND c.relname = 'foo'; relname |  spcname  ---------+----------- foo     | testspace(1 row)INSERT INTO testschema.foo VALUES(1);INSERT INTO testschema.foo VALUES(2);-- indexCREATE INDEX foo_idx on testschema.foo(i) TABLESPACE testspace;SELECT relname, spcname FROM pg_catalog.pg_tablespace t, pg_catalog.pg_class c    where c.reltablespace = t.oid AND c.relname = 'foo_idx'; relname |  spcname  ---------+----------- foo_idx | testspace(1 row)-- Will fail with bad pathCREATE TABLESPACE badspace LOCATION '/no/such/location';ERROR:  could not set permissions on directory "/no/such/location": No such file or directory-- No such tablespaceCREATE TABLE bar (i int) TABLESPACE nosuchspace;ERROR:  tablespace "nosuchspace" does not exist-- Fail, not emptyDROP TABLESPACE testspace;ERROR:  tablespace "testspace" is not emptyDROP SCHEMA testschema CASCADE;NOTICE:  drop cascades to table testschema.foo-- Should succeedDROP TABLESPACE testspace;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -