数据库选型时遇到PostgreSQL的一个问题
一个笨办法,通过sql语句查到表对应的文件,将文件mv出来,用的时候再mv进去。mv出来时,表在数据库可见,但是访问会提示文件不存在;mv回去后可以正常访问。mydb=# select relname, nspname, spcname, pg_relation_filepath(tc.relname::regclass), pg_size_pretty(pg_relation_size(tc.relname::regclass)) from pg_class tc, pg_namespace tn, pg_tablespace tt where tn.oid = tc.relnamespace and tt.oid = tc.reltablespace and relname = 'test1';relnamenspnamespcnamepg_relation_filepathpg_size_prettytest1publictestpg_tblspc/19846/PG_9.5_201510051/19697/2028140 kB(1 row)mydb=# db List of tablespaces
Name | Owner | Locationpg_defaultapplepg_globalappletestpostgres/usr/local/pgsql/test_name_space(3 rows)
赞0
踩0