玖叶教程网

前端编程开发入门

PostgreSQL安装与配置

1.通过二进制安装包安装 centos 7

通过这个  https://www.postgresql.org/download 
选择对应的版本,就可以获得相应的安装方法,官网支持很强大。

Centos 7版本安装如下
安装PostgreSQL yum仓库
sudo yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm

安装PostgreSQL:
sudo yum install -y postgresql13-server

安装扩展模块
sudo yum install -y postgresql13-contrib.x86_64

初始化数据库,设置开机启动
sudo /usr/pgsql-13/bin/postgresql-13-setup initdb
sudo systemctl enable postgresql-13
sudo systemctl start postgresql-13

在Centos或Redhat下,默认安装上的PostgreSQL的数据目录在/var/lib/pgsql/13/data/
[root@node1 ~]# ls -l /var/lib/pgsql/13/data/
total 64
drwx------ 5 postgres postgres    38 Feb 27 01:25 base
-rw------- 1 postgres postgres    30 Feb 27 01:25 current_logfiles
drwx------ 2 postgres postgres  4096 Feb 27 01:26 global
drwx------ 2 postgres postgres    31 Feb 27 01:25 log
drwx------ 2 postgres postgres     6 Feb 27 01:25 pg_commit_ts
drwx------ 2 postgres postgres     6 Feb 27 01:25 pg_dynshmem
-rw------- 1 postgres postgres  4548 Feb 27 01:25 pg_hba.conf
-rw------- 1 postgres postgres  1636 Feb 27 01:25 pg_ident.conf
drwx------ 4 postgres postgres    65 Feb 27 03:25 pg_logical
drwx------ 4 postgres postgres    34 Feb 27 01:25 pg_multixact
drwx------ 2 postgres postgres     6 Feb 27 01:25 pg_notify
drwx------ 2 postgres postgres     6 Feb 27 01:25 pg_replslot
drwx------ 2 postgres postgres     6 Feb 27 01:25 pg_serial
drwx------ 2 postgres postgres     6 Feb 27 01:25 pg_snapshots
drwx------ 2 postgres postgres     6 Feb 27 01:25 pg_stat
drwx------ 2 postgres postgres    60 Feb 27 03:40 pg_stat_tmp
drwx------ 2 postgres postgres    17 Feb 27 01:25 pg_subtrans
drwx------ 2 postgres postgres     6 Feb 27 01:25 pg_tblspc
drwx------ 2 postgres postgres     6 Feb 27 01:25 pg_twophase
-rw------- 1 postgres postgres     3 Feb 27 01:25 PG_VERSION
drwx------ 3 postgres postgres    58 Feb 27 01:25 pg_wal
drwx------ 2 postgres postgres    17 Feb 27 01:25 pg_xact
-rw------- 1 postgres postgres    88 Feb 27 01:25 postgresql.auto.conf
-rw------- 1 postgres postgres 28017 Feb 27 01:25 postgresql.conf
-rw------- 1 postgres postgres    58 Feb 27 01:25 postmaster.opts
-rw------- 1 postgres postgres   103 Feb 27 01:25 postmaster.pid

PostgreSQL - 批量复制文本文件到数据表

使用数据库时,经常需要把许多csv格式或txt格式文件的内容复制到数据库的表中,在文件数量比较少的情况下,可以使用INSERT命令完成。但是如果文本文件数量非常多,使用INSERT命令把数据插入到数据表,不仅需要先读取各个文本文件的内容,并且转换为适合INSERT命令使用的格式,而且操作比较繁琐,耗费时间多。这种情况下,应该使用数据库系统提供的复制数据的命令。以下为PostgreSQL数据库系统中,大批量复制文本文件的数据到数据表的应用实例。

PostgreSQL 作为向量数据库:入门和扩展

了解如何使用 PostgreSQL 作为矢量数据库来构建和扩展示例 Airbnb 推荐服务。

数据操作必备技能:PostgreSQL中插入、更新和删除数据的实战指南

当涉及到数据的插入、更新和删除操作时,PostgreSQL是一个功能强大且广泛使用的关系型数据库管理系统。下面我将为你详细讲解这些操作,并提供一些示例代码和最佳实践。

PostgreSQL本地/远程登陆配置

特别说明:该专栏文章均来源自微信公众号《大数据实战演练》,欢迎关注!

PostgreSQL版本:9.6.12

关于PostgreSQL与PostGIS使用,可参考

python开发-操作postgresql数据库

今天介绍一下如何在python3中使用psycopg2操作Postgresql数据库。

首先psycopg2的官方文档网址如下:

http://initd.org/psycopg/docs/

cursor类的网址如下:

http://initd.org/psycopg/docs/cursor.html

PL/pgSQL编写postgresql函数之基本语句

目录

基本语句

1 赋值

赋值运算符 := 或 =

2 单一行结果返回

SELECT...INTO 语法赋值

如何在Postgre SQL输入命令

进入后,如何输入命令呢

新手进入pg,居然不知道输入什么?输入help试一下:

postgres-# help

Use \? for help or press control-C to clear the input buffer.

原来要输入 \? 才是帮助

超详细的pg12.2数据库五种备份恢复机制总结,值得收藏

概述

备份重于一切,今天主要介绍PG的五种备份方式,仅供参考。

ps:前四种重点掌握


PostgreSQL 10.23 安装图文教程

<< < 1 2 3 4 5 6 7 > >>
控制面板
您好,欢迎到访网站!
  查看权限
网站分类
最新留言