• pg创建表空间


    ####创建表空间
    [postgres@harbor ~]$ cd /pgccc/ && mdir mytablespace && sudo chown -R postgres. /pgccc/mytablespace
    [postgres@harbor pgccc]$ ls -la
    总用量 4
    drwxr-xr-x 5 root root 57 9月 12 14:34 .
    dr-xr-xr-x. 19 root root 269 9月 2 16:58 ..
    drwx------ 3 postgres postgres 29 9月 12 14:37 mytablespace
    drwx------ 20 postgres postgres 4096 9月 12 10:09 pgdata
    drwxr-xr-x 6 postgres postgres 56 9月 2 17:07 pgsqlbase
    [postgres@harbor pgccc]$ cd mytablespace/
    [postgres@harbor mytablespace]$ ll
    总用量 0
    drwx------ 2 postgres postgres 6 9月 12 14:37 PG_14_202107181
    [postgres@harbor mytablespace]$ ls -la
    总用量 0
    drwx------ 3 postgres postgres 29 9月 12 14:37 .
    drwxr-xr-x 5 root root 57 9月 12 14:34 ..
    drwx------ 2 postgres postgres 6 9月 12 14:37 PG_14_202107181
    [postgres@harbor mytablespace]$ cd ll
    -bash: cd: ll: 没有那个文件或目录
    [postgres@harbor mytablespace]$ cd /pgccc/pgdata/
    [postgres@harbor pgdata]$ ll
    总用量 72
    drwx------ 6 postgres postgres 54 9月 5 09:59 base
    -rw------- 1 postgres postgres 44 9月 12 10:09 current_logfiles
    drwx------ 2 postgres postgres 4096 9月 12 10:09 global
    drwx------ 2 postgres postgres 4096 9月 12 10:09 log
    drwx------ 2 postgres postgres 6 9月 2 17:08 pg_commit_ts
    drwx------ 2 postgres postgres 6 9月 2 17:08 pg_dynshmem
    -rw------- 1 postgres postgres 4867 9月 2 18:31 pg_hba.conf
    -rw------- 1 postgres postgres 1636 9月 2 17:08 pg_ident.conf
    drwx------ 4 postgres postgres 68 9月 12 14:39 pg_logical
    drwx------ 4 postgres postgres 36 9月 2 17:08 pg_multixact
    drwx------ 2 postgres postgres 6 9月 2 17:08 pg_notify
    drwx------ 2 postgres postgres 6 9月 2 17:08 pg_replslot
    drwx------ 2 postgres postgres 6 9月 2 17:08 pg_serial
    drwx------ 2 postgres postgres 6 9月 12 13:17 pg_snapshots
    drwx------ 2 postgres postgres 6 9月 12 10:09 pg_stat
    drwx------ 2 postgres postgres 84 9月 12 14:39 pg_stat_tmp
    drwx------ 2 postgres postgres 18 9月 2 17:08 pg_subtrans
    drwx------ 2 postgres postgres 19 9月 12 14:37 pg_tblspc
    drwx------ 2 postgres postgres 6 9月 2 17:08 pg_twophase
    -rw------- 1 postgres postgres 3 9月 2 17:08 PG_VERSION
    drwx------ 3 postgres postgres 220 9月 9 17:37 pg_wal
    drwx------ 2 postgres postgres 18 9月 2 17:08 pg_xact
    -rw------- 1 postgres postgres 88 9月 2 17:08 postgresql.auto.conf
    -rw------- 1 postgres postgres 28718 9月 7 16:22 postgresql.conf
    -rw------- 1 postgres postgres 30 9月 12 10:09 postmaster.opts
    -rw------- 1 postgres postgres 71 9月 12 10:09 postmaster.pid
    [postgres@harbor pgdata]$ cd pg_tblspc/
    [postgres@harbor pg_tblspc]$ ll
    总用量 0
    lrwxrwxrwx 1 postgres postgres 19 9月 12 14:37 25662 -> /pgccc/mytablespace

    postgres=# \db+
    List of tablespaces
    Name | Owner | Location | Access privileges | Options | Size | Description
    --------------+----------+---------------------+-------------------+---------+---------+-------------
    mytablespace | postgres | /pgccc/mytablespace | | | 0 bytes |
    pg_default | postgres | | | | 74 MB |
    pg_global | postgres | | | | 368 kB |
    (3 rows)

    postgres=# \c tt
    You are now connected to database "tt" as user "postgres".
    tt=# create table mytablespace(id int,info text) TABLESPACE mytablespace;
    CREATE TABLE
    Time: 36.848 ms
    tt=# \db+ mytablespace
    List of tablespaces
    Name | Owner | Location | Access privileges | Options | Size | Description
    --------------+----------+---------------------+-------------------+---------+------------+-------------
    mytablespace | postgres | /pgccc/mytablespace | | | 8237 bytes |
    (1 row)

     

  • 相关阅读:
    Writing Custom Providers
    terraform 几个方便的工具
    几张简单的terraform flow 图——可以快速了解terraform的使用
    Stateful Kubernetes Applications Made Easier: PSO and FlashBlade
    使用k8s && minio 进行 postgres 数据库自动备份
    Understanding how uid and gid work in Docker containers
    nightwatchjs 基于nodejs&& webdriver 协议的自动化测试&&持续集成框架
    hasura graphql-engine graphql2chartjs 方便的graphql 转换chartjs 的类库
    nginx unit 1.8 支持基于java servlet 的开发模型
    试用 openresty/lua-resty-shell
  • 原文地址:https://www.cnblogs.com/chinaops/p/16686192.html
Copyright © 2020-2023  润新知