PostgreSQL 10操作快速入门实验

本实验指导初学者如何在VirtualBox上的CentOS7中安装并操作PostgreSQL 10,涵盖从安装VirtualBox和CentOS7,到安装数据库、基本操作及数据导入流程。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

PostgreSQL 10操作快速入门实验

参考 PostgreSQL学习手册:https://www.postgresql.org/docs/10/

实验前提:先在电脑上用VirtualBox安装一台CentOS7虚拟机,然后在CentOS7上安装 PostgreSQL 10

一、安装VirtualBox(自行Google)

二、在VirtualBox上安装CentOS7(自行Google)

三、安装 PostgreSQL on CentOS7

sudo yum update -y

yum install https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-7-x86_64/pgdg-centos10-10-2.noarch.rpm -y

yum install postgresql10-contrib postgresql10-server -y
rpm -qa | grep postgresql
输出结果:
postgresql10-server-10.11-2PGDG.rhel7.x86_64
postgresql10-libs-10.11-2PGDG.rhel7.x86_64
postgresql10-10.11-2PGDG.rhel7.x86_64
postgresql-libs-9.2.24-1.el7_5.x86_64
postgresql10-contrib-10.11-2PGDG.rhel7.x86_64

[root@vl-bg-anaylsis02 ~]# /usr/pgsql-10/bin/postgresql-10-setup initdb
输出结果:
Initializing database ... OK

# 启动postgresql
[root@vl-bg-anaylsis02 ~]# sudo systemctl start postgresql-10
# 设置开机自动启动
[root@vl-bg-anaylsis02 ~]# sudo systemctl enable postgresql-10.service

# postgres账号登录psql
su - postgres
psql

# 在psql中对postgresql进行操作
postgres=# ALTER USER postgres WITH PASSWORD 'post123'
postgres-# \du
postgres=# \l
postgres=# \q

# 切换到系统的root账号,对配置文件进行配置
su - root
vi /var/lib/pgsql/10/data/postgresql.conf
/var/lib/pgsql/10/data/postgresql.conf配置文件更改后的最终内容:
------------------------
ASIN: B077NQGV1G, ISBN: 1788392019 Year: 2017 Format: AZW3 Pages: 488 pages Leverage the power of PostgreSQL 10 to build powerful database and data warehousing applications. About This Book Be introduced to the concept of relational databases and PostgreSQL, one of the fastest growing open source databases in the world Learn client-side and server-side programming in PostgreSQL, and how to administer PostgreSQL databases Discover tips on implementing efficient database solutions with PostgreSQL 10 Who This Book Is For If you're interested in learning more about PostgreSQL - one of the most popular relational databases in the world, then this book is for you. Those looking to build solid database or data warehousing applications with PostgreSQL 10 will also find this book a useful resource. No prior knowledge of database programming or administration is required to get started with this book. What You Will Learn Understand the fundamentals of relational databases, relational algebra, and data modeling Install a PostgreSQL cluster, create a database, and implement your data model Create tables and views, define indexes, and implement triggers, stored procedures, and other schema objects Use the Structured Query Language (SQL) to manipulate data in the database Implement business logic on the server side with triggers and stored procedures using PL/pgSQL Make use of advanced data types supported by PostgreSQL 10: Arrays, hstore, JSONB, and others Develop OLAP database solutions using the most recent features of PostgreSQL 10 Connect your Python applications to a PostgreSQL database and work with the data efficiently Test your database code, find bottlenecks, improve performance, and enhance the reliability of the database applications In Detail PostgreSQL is one of the most popular open source databases in the world, and supports the most advanced features included in SQL standards and beyond. This book will familiarize you with the latest new fe
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值