美文网首页
postgrsql-安装和初步配置

postgrsql-安装和初步配置

作者: wo是大富 | 来源:发表于2019-11-27 13:39 被阅读0次

    背景:
    centos 7.4
    postgresql 10

    cat >> /etc/yum.repos.d/pgdg-redhat-all.repo <<EOF
    
    # PGDG Red Hat Enterprise Linux / CentOS stable repositories:
    
    [pgdg12]
    name=PostgreSQL 12 for RHEL/CentOS $releasever - $basearch
    baseurl=https://download.postgresql.org/pub/repos/yum/12/redhat/rhel-$releasever-$basearch
    enabled=1
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG
    
    [pgdg11]
    name=PostgreSQL 11 for RHEL/CentOS $releasever - $basearch
    baseurl=https://download.postgresql.org/pub/repos/yum/11/redhat/rhel-$releasever-$basearch
    enabled=1
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG
    
    [pgdg10]
    name=PostgreSQL 10 for RHEL/CentOS $releasever - $basearch
    baseurl=https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-$releasever-$basearch
    enabled=1
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG
    
    
    # PGDG for RHEL/CentOS Updates Testing repositories. (These packages should not be used in production)
    # Available for 9.6 and above.
    
    [pgdg13-updates-testing]
    name=PostgreSQL 13 for RHEL/CentOS $releasever - $basearch - Updates testing
    baseurl=https://download.postgresql.org/pub/repos/yum/testing/13/redhat/rhel-$releasever-$basearch
    enabled=0
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG
    
    [pgdg12-updates-testing]
    name=PostgreSQL 12 for RHEL/CentOS $releasever - $basearch - Updates testing
    baseurl=https://download.postgresql.org/pub/repos/yum/testing/12/redhat/rhel-$releasever-$basearch
    enabled=0
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG
    
    [pgdg11-updates-testing]
    name=PostgreSQL 11 for RHEL/CentOS $releasever - $basearch - Updates testing
    baseurl=https://download.postgresql.org/pub/repos/yum/testing/11/redhat/rhel-$releasever-$basearch
    enabled=0
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG
    
    [pgdg10-updates-testing]
    name=PostgreSQL 10 for RHEL/CentOS $releasever - $basearch - Updates testing
    baseurl=https://download.postgresql.org/pub/repos/yum/testing/10/redhat/rhel-$releasever-$basearch
    enabled=0
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG
    
    # Source RPMs (SRPM), and their testing repositories:
    
    [pgdg12-source]
    name=PostgreSQL 12 for RHEL/CentOS $releasever - $basearch - Source
    failovermethod=priority
    baseurl=https://download.postgresql.org/pub/repos/yum/srpms/12/redhat/rhel-$releasever-$basearch
    enabled=0
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG
    
    [pgdg12-source-updates-testing]
    name=PostgreSQL 12 for RHEL/CentOS $releasever - $basearch - Source update testing
    failovermethod=priority
    baseurl=https://download.postgresql.org/pub/repos/yum/srpms/testing/12/redhat/rhel-$releasever-$basearch
    enabled=0
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG
    
    [pgdg11-source]
    name=PostgreSQL 11 for RHEL/CentOS $releasever - $basearch - Source
    failovermethod=priority
    baseurl=https://download.postgresql.org/pub/repos/yum/srpms/11/redhat/rhel-$releasever-$basearch
    enabled=0
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG
    
    [pgdg11-source-updates-testing]
    name=PostgreSQL 11 for RHEL/CentOS $releasever - $basearch - Source update testing
    failovermethod=priority
    baseurl=https://download.postgresql.org/pub/repos/yum/srpms/testing/11/redhat/rhel-$releasever-$basearch
    enabled=0
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG
    
    [pgdg10-source]
    name=PostgreSQL 10 for RHEL/CentOS $releasever - $basearch - Source
    failovermethod=priority
    baseurl=https://download.postgresql.org/pub/repos/yum/srpms/10/redhat/rhel-$releasever-$basearch
    enabled=0
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG
    
    [pgdg10-source-updates-testing]
    name=PostgreSQL 10 for RHEL/CentOS $releasever - $basearch - Source update testing
    failovermethod=priority
    baseurl=https://download.postgresql.org/pub/repos/yum/srpms/testing/10/redhat/rhel-$releasever-$basearch
    enabled=0
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG
    EOF
    

    安装

    yum install postgresql10 postgresql10-server -y
    

    确认


    确认版本

    相关文章

      网友评论

          本文标题:postgrsql-安装和初步配置

          本文链接:https://www.haomeiwen.com/subject/qbdpwctx.html