ramfs_based_table_space
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| ramfs_based_table_space [2012/03/23 19:38] – created k2patel | ramfs_based_table_space [2020/08/10 02:35] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 2: | Line 2: | ||
| - | === Setting up a tablespace === | + | ==== Setting up a tablespace |
| Line 8: | Line 8: | ||
| - | | + | Tablespaces in PostgreSQL allow database administrators to define locations in the file system where the files \\ |
| - | representing database objects can be stored. Once created, a tablespace can be referred to by name when creating \\ | + | representing database objects can be stored. Once created, a tablespace can be referred to by name when creating \\ |
| - | database objects.The location must be an existing, empty directory that is owned by the PostgreSQL system user. \\ | + | database objects.The location must be an existing, empty directory that is owned by the PostgreSQL system user. \\ |
| - | All objects subsequently created within the tablespace will be stored in files underneath this directory. \\ | + | All objects subsequently created within the tablespace will be stored in files underneath this directory. \\ |
| - | Creation of the tablespace itself must be done as a database superuser, but after that you can allow ordinary \\ | + | Creation of the tablespace itself must be done as a database superuser, but after that you can allow ordinary \\ |
| - | database users to make use of it. To do that, grant them the CREATE privilege on it. | + | database users to make use of it. To do that, grant them the CREATE privilege on it. |
| First create the directory where tablespace will be stored. It must reside on your ramfs filesystem. | First create the directory where tablespace will be stored. It must reside on your ramfs filesystem. | ||
| Line 79: | Line 79: | ||
| - | | + | == Dump database schema: == |
| <code bash> | <code bash> | ||
| - | pg_dump --create --schema-only --file=/ | + | |
| </ | </ | ||
| - | | + | Stop postmaster (original init code) |
| - | Unmount ramfs: | + | == Unmount ramfs: |
| - | + | | |
| <code bash> | <code bash> | ||
| | | ||
| Line 95: | Line 95: | ||
| - | | + | == Mount ramfs: == |
| Line 105: | Line 105: | ||
| </ | </ | ||
| - | | + | == Recreate PostgreSQL tablespace directory: == |
| Line 116: | Line 116: | ||
| - | | + | == Start postmaster (original init code) == |
| - | | + | Drop the database because it exists in PostgreSQL system tables only. |
| <code bash> | <code bash> | ||
| Line 124: | Line 124: | ||
| </ | </ | ||
| | | ||
| - | | + | == Restore the database schema: == |
| | | ||
| Line 136: | Line 136: | ||
| You have just learned how to set up memory storage for the PostgreSQL database server. \\ | You have just learned how to set up memory storage for the PostgreSQL database server. \\ | ||
| + | [[http:// | ||
ramfs_based_table_space.1332531538.txt.gz · Last modified: 2020/08/10 02:29 (external edit)
