Postgresql数据库详细信息

Postgresql数据库详细信息,postgresql,ubuntu,Postgresql,Ubuntu,首先,让我先介绍一下我的环境: Ubuntu服务器16.04 LTS Postgresql 12=我在/var/lib/Postgresql/12/main上安装了它 内部/var/lib/postgresql/12/main: drwx------ 10 postgres postgres 4096 Feb 21 17:13 base drwx------ 2 postgres postgres 4096 Feb 26 19:29 global drwx------ 2 postgres

首先,让我先介绍一下我的环境:

  • Ubuntu服务器16.04 LTS
  • Postgresql 12=我在/var/lib/Postgresql/12/main上安装了它
  • 内部/var/lib/postgresql/12/main:

    drwx------ 10 postgres postgres 4096 Feb 21 17:13 base
    drwx------  2 postgres postgres 4096 Feb 26 19:29 global
    drwx------  2 postgres postgres 4096 Jan  9 16:54 pg_commit_ts
    drwx------  2 postgres postgres 4096 Jan  9 16:54 pg_dynshmem
    drwx------  4 postgres postgres 4096 Feb 26 19:33 pg_logical
    drwx------  4 postgres postgres 4096 Jan  9 16:54 pg_multixact
    drwx------  2 postgres postgres 4096 Feb 26 19:28 pg_notify
    drwx------  2 postgres postgres 4096 Jan  9 16:54 pg_replslot
    drwx------  2 postgres postgres 4096 Jan  9 16:54 pg_serial
    drwx------  2 postgres postgres 4096 Jan  9 16:54 pg_snapshots
    drwx------  2 postgres postgres 4096 Feb 26 19:28 pg_stat
    drwx------  2 postgres postgres 4096 Jan  9 16:54 pg_stat_tmp
    drwx------  2 postgres postgres 4096 Jan  9 16:54 pg_subtrans
    drwx------  2 postgres postgres 4096 Jan  9 16:54 pg_tblspc
    drwx------  2 postgres postgres 4096 Jan  9 16:54 pg_twophase
    -rw-------  1 postgres postgres    3 Jan  9 16:54 PG_VERSION
    drwx------  3 postgres postgres 4096 Feb 17 19:07 pg_wal
    drwx------  2 postgres postgres 4096 Jan  9 16:54 pg_xact
    -rw-------  1 postgres postgres   88 Jan  9 16:54 postgresql.auto.conf
    -rw-------  1 postgres postgres  130 Feb 26 19:28 postmaster.opts
    -rw-------  1 postgres postgres  101 Feb 26 19:28 postmaster.pid
    
    当我想填写PostgreSQL连接的详细信息时,我有点困惑。填写什么PGBIN

    #!/bin/bash
    #Provide your database details here -----
    export PGBIN=path_to_psql
    export PGHOST=localhost
    export PGPORT=5433
    export CITYDB=3dcitydb
    export PGUSER=postgres
    
    关于,


    Yogi

    连接信息不需要“pgbin”属性。要在环境变量中指定数据库,应使用
    PGDATABASE
    为什么端口为5433?默认情况下是5432。@没有名字的\u horse\u我需要安装3citydb,它需要我填写连接的详细信息。要指定数据库,您应该使用
    export PGDATABASE=3dcitydb
    所有环境变量都记录在这里:@jnevil好的。我在/usr/bin/psql上得到了它,所以它应该是/usr/bin。谢谢:)