pgadmin4中的备份与恢复

一,postgresql 数据的备份与恢复

(一)数据库备份与恢复

1,备份

windows环境

1> dump 逻辑备份

1,用管理员身份打开power shell
在这里插入图片描述
2,切换到本机 postgresql 安装目录下的 bin 目录:

PS C:\Users\DFL> cd D:\DFL\SOFTWARES\postgresql14\bin
PS D:\DFL\SOFTWARES\postgresql14\bin>

3,执行 dump ,将 test 数据库备份到桌面文件 appdb.bak :

PS D:\DFL\SOFTWARES\postgresql14\bin> .\pg_dump -h localhost -p 5432 -U postgres  -d test > C:\Users\DFL\Desktop\appdb.bak
口令:

2> COPY 逻辑备份

Linux(ubuntu)环境

(二)数据表备份与恢复

二,pgadmin4

(一)备份

1,备份 table

在这里插入图片描述在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
2,备份详情:

请求参数:

gid1
sid=1
data={'file': '/student.bak.backup', 'format': 'plain', 'id': None, 'blobs': True, 'verbose': True, 'encoding': 'UTF8', 'role': 'postgres', 'only_data': True, 'use_insert_commands': True, 'include_create_database': True, 'disable_trigger': True, 'disable_quoting': True, 'database': 'postgres', 'tables': [['public', 'student']]}

pgadmin4数据备份源码:

web/pgadmin/tools/backup/__init__.py:
@blueprint.route('/job/<int:sid>', methods=['POST'], endpoint='create_server_job'
)
@blueprint.route('/job/<int:sid>/object', methods=['POST'], endpoint='create_object_job'
)
@login_required
def create_backup_objects_job(sid):"""Args:sid: Server IDCreates a new job for backup task(Backup Database(s)/Schema(s)/Table(s))Returns:None"""# 获取请求data = json.loads(request.data, encoding='utf-8')backup_obj_type = data.get('type', 'objects')try:# 获取文件路径backup_file = filename_with_file_manager_path(data['file'], (data.get('format', '') != 'directory'))except Exception as e:return bad_request(errormsg=str(e))# 获取服务器信息server = get_server(sid)if server is None:return make_json_response(success=0,errormsg=_("Could not find the specified server."))# To fetch MetaData for the serverfrom pgadmin.utils.driver import get_driverdriver = get_driver(PG_DEFAULT_DRIVER)manager = driver.connection_manager(server.id)conn = manager.connection()connected = conn.connected()if not connected:return make_json_response(success=0,errormsg=_("Please connect to the server first."))# 获取备份工具,这里是 pg_dumputility = manager.utility('backup') if backup_obj_type == 'objects' \else manager.utility('backup_server')ret_val = does_utility_exist(utility)if ret_val:return make_json_response(success=0,errormsg=ret_val)# 准备填充 dump 命令的参数# ['--file', '/var/lib/pgadmin/storage/dangfulin2333_163.com/student.bak.backup', '--host', '127.0.0.1', '--port', '5432', '--username', 'postgres', '--no-password', '--verbose', '--role', 'postgres', '--format=p', '--data-only', '--disable-triggers', '--create', '--inserts', '--disable-dollar-quoting', '--encoding', 'UTF8', '--table', 'public.student']args = _get_args_params_values(data, conn, backup_obj_type, backup_file, server, manager)# 这里将参数中的所有双引号转义,因为双引号在shell命令行中具有特殊含义,它们在没有双引号的情况下运行。添加额外的引号以保存我们的双引号。escaped_args = [escape_dquotes_process_arg(arg) for arg in args]try:# 用 utf-8 编码文件名bfile = data['file'].encode('utf-8') \if hasattr(data['file'], 'encode') else data['file']# 区分不同的备份类型if backup_obj_type == 'objects':    # 备份数据对象(数据库、模式、表)数据args.append(data['database'])escaped_args.append(data['database'])p = BatchProcess(desc=BackupMessage(BACKUP.OBJECT, server.id, bfile,*args,database=data['database']),cmd=utility, args=escaped_args)else:                               # 备份服务器数据p = BatchProcess(desc=BackupMessage(BACKUP.SERVER if backup_obj_type != 'globals'else BACKUP.GLOBALS,server.id, bfile,*args),cmd=utility, args=escaped_args)manager.export_password_env(p.id)# Check for connection timeout and if it is greater than 0 then# set the environment variable PGCONNECT_TIMEOUT.if manager.connect_timeout > 0:env = dict()env['PGCONNECT_TIMEOUT'] = str(manager.connect_timeout)p.set_env_variables(server, env=env)else:p.set_env_variables(server)# 创建子进程,执行 pg_dump 命令p.start()jid = p.idexcept Exception as e:current_app.logger.exception(e)return make_json_response(status=410,success=0,errormsg=str(e))# Return responsereturn make_json_response(data={'job_id': jid, 'desc': p.desc.message, 'Success': 1})

右下角显示进程任务执行信息:
在这里插入图片描述
查看进程任务:在这里插入图片描述查看备份任务执行情况:
在这里插入图片描述

查看任务务行详情:
在这里插入图片描述- 红框中就是备份数据表时执行的 dump 命令。

下载备份文件:
在这里插入图片描述
3,备份文件:

--
-- PostgreSQL database dump
---- Dumped from database version 14.9 (Ubuntu 14.9-0ubuntu0.22.04.1)
-- Dumped by pg_dump version 14.9 (Ubuntu 14.9-0ubuntu0.22.04.1)-- Started on 2023-08-23 18:01:11 CSTSET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;--
-- TOC entry 3640 (class 1262 OID 13799)
-- Name: postgres; Type: DATABASE; Schema: -; Owner: postgres
--CREATE DATABASE postgres WITH TEMPLATE = template0 ENCODING = 'UTF8' LOCALE = 'zh_CN.UTF-8';ALTER DATABASE postgres OWNER TO postgres;\connect postgresSET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;--
-- TOC entry 3634 (class 0 OID 24580)
-- Dependencies: 213
-- Data for Name: student; Type: TABLE DATA; Schema: public; Owner: postgres
--SET SESSION AUTHORIZATION DEFAULT;ALTER TABLE public.student DISABLE TRIGGER ALL;INSERT INTO public.student VALUES (1, 1, 'tname1');
INSERT INTO public.student VALUES (2, 1, 'tname1');
INSERT INTO public.student VALUES (3, 2, 'tname2');
INSERT INTO public.student VALUES (4, 3, 'tname3');
INSERT INTO public.student VALUES (5, 3, 'tname3');ALTER TABLE public.student ENABLE TRIGGER ALL;-- Completed on 2023-08-23 18:01:11 CST--
-- PostgreSQL database dump complete
--

5,备份 schema

1,对话框
在这里插入图片描述在这里插入图片描述在这里插入图片描述
在这里插入图片描述
在这里插入图片描述2,备份信息:

@blueprint.route('/job/<int:sid>', methods=['POST'], endpoint='create_server_job'
)
@blueprint.route('/job/<int:sid>/object', methods=['POST'], endpoint='create_object_job'
)
@login_required
def create_backup_objects_job(sid):"""Args:sid: Server IDCreates a new job for backup task(Backup Database(s)/Schema(s)/Table(s))Returns:None"""# 获取请求# {'file': 'psche', 'format': 'plain', 'id': None, 'blobs': True, 'verbose': True, 'encoding': 'UTF8', 'role': 'postgres', 'data': True, 'dns_owner': True, 'dns_tablespace': True, 'dns_unlogged_tbl_data': True, 'no_comments': True, 'use_insert_commands': True, 'include_create_database': True, 'include_drop_database': True, 'database': 'postgres', 'schemas': ['public']}data = json.loads(request.data, encoding='utf-8')# 'objects'backup_obj_type = data.get('type', 'objects')try:# 获取文件路径# '/var/lib/pgadmin/storage/dangfulin2333_163.com/psche'backup_file = filename_with_file_manager_path(data['file'], (data.get('format', '') != 'directory'))except Exception as e:return bad_request(errormsg=str(e))# 获取服务器信息# <Server 1>server = get_server(sid)if server is None:return make_json_response(success=0,errormsg=_("Could not find the specified server."))# To fetch MetaData for the serverfrom pgadmin.utils.driver import get_driverdriver = get_driver(PG_DEFAULT_DRIVER)manager = driver.connection_manager(server.id)conn = manager.connection()connected = conn.connected()if not connected:return make_json_response(success=0,errormsg=_("Please connect to the server first."))# 获取备份工具# '/usr/lib/postgresql/14/bin/pg_dump'utility = manager.utility('backup') if backup_obj_type == 'objects' \else manager.utility('backup_server')ret_val = does_utility_exist(utility)if ret_val:return make_json_response(success=0,errormsg=ret_val)# 工具参数# ['--file', '/var/lib/pgadmin/storage/dangfulin2333_163.com/psche', '--host', '127.0.0.1', '--port', '5432', '--username', 'postgres', '--no-password', '--verbose', '--role', 'postgres', '--format=p', '--no-owner', '--create', '--clean', '--section=data', '--no-tablespaces', '--no-unlogged-table-data', '--inserts', '--no-comments', '--encoding', 'UTF8', '--schema', 'public', 'postgres']args = _get_args_params_values(data, conn, backup_obj_type, backup_file, server, manager)# 这里将参数中的所有双引号转义,因为双引号在shell命令行中具有特殊含义,它们在没有双引号的情况下运行。添加额外的引号以保存我们的双引号。# ['--file', '/var/lib/pgadmin/storage/dangfulin2333_163.com/psche', '--host', '127.0.0.1', '--port', '5432', '--username', 'postgres', '--no-password', '--verbose', '--role', 'postgres', '--format=p', '--no-owner', '--create', '--clean', '--section=data', '--no-tablespaces', '--no-unlogged-table-data', '--inserts', '--no-comments', '--encoding', 'UTF8', '--schema', 'public', 'postgres']escaped_args = [escape_dquotes_process_arg(arg) for arg in args]try:# 用 utf-8 编码文件名bfile = data['file'].encode('utf-8') \if hasattr(data['file'], 'encode') else data['file']# 区分不同的备份类型if backup_obj_type == 'objects':    # 备份数据对象(数据库、模式、表)数据args.append(data['database'])# ['--file', '/var/lib/pgadmin/storage/dangfulin2333_163.com/psche', '--host', '127.0.0.1', '--port', '5432', '--username', 'postgres', '--no-password', '--verbose', '--role', 'postgres', '--format=p', '--no-owner', '--create', '--clean', '--section=data', '--no-tablespaces', '--no-unlogged-table-data', '--inserts', '--no-comments', '--encoding', 'UTF8', '--schema', 'public', 'postgres']escaped_args.append(data['database'])# ['--file', '/var/lib/pgadmin/storage/dangfulin2333_163.com/psche', '--host', '127.0.0.1', '--port', '5432', '--username', 'postgres', '--no-password', '--verbose', '--role', 'postgres', '--format=p', '--no-owner', '--create', '--clean', '--section=data', '--no-tablespaces', '--no-unlogged-table-data', '--inserts', '--no-comments', '--encoding', 'UTF8', '--schema', 'public', 'postgres']p = BatchProcess(desc=BackupMessage(BACKUP.OBJECT, server.id, bfile,*args,database=data['database']),cmd=utility, args=escaped_args)else:                               # 备份服务器数据p = BatchProcess(desc=BackupMessage(BACKUP.SERVER if backup_obj_type != 'globals'else BACKUP.GLOBALS,server.id, bfile,*args),cmd=utility, args=escaped_args)manager.export_password_env(p.id)# Check for connection timeout and if it is greater than 0 then# set the environment variable PGCONNECT_TIMEOUT.if manager.connect_timeout > 0:env = dict()env['PGCONNECT_TIMEOUT'] = str(manager.connect_timeout)p.set_env_variables(server, env=env)else:p.set_env_variables(server)# 创建子进程,执行 pg_dump 命令p.start()jid = p.idexcept Exception as e:current_app.logger.exception(e)return make_json_response(status=410,success=0,errormsg=str(e))# Return responsereturn make_json_response(data={'job_id': jid, 'desc': p.desc.message, 'Success': 1})

在这里插入图片描述3,备份文件:

--
-- PostgreSQL database dump
---- Dumped from database version 14.9 (Ubuntu 14.9-0ubuntu0.22.04.1)
-- Dumped by pg_dump version 14.9 (Ubuntu 14.9-0ubuntu0.22.04.1)-- Started on 2023-08-24 08:52:15 CSTSET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;DROP DATABASE postgres;
--
-- TOC entry 3671 (class 1262 OID 13799)
-- Name: postgres; Type: DATABASE; Schema: -; Owner: -
--CREATE DATABASE postgres WITH TEMPLATE = template0 ENCODING = 'UTF8' LOCALE = 'zh_CN.UTF-8';\connect postgresSET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;--
-- TOC entry 3662 (class 0 OID 24629)
-- Dependencies: 216
-- Data for Name: circles; Type: TABLE DATA; Schema: public; Owner: -
----
-- TOC entry 3664 (class 0 OID 25273)
-- Dependencies: 218
-- Data for Name: company6; Type: TABLE DATA; Schema: public; Owner: -
----
-- TOC entry 3665 (class 0 OID 25280)
-- Dependencies: 219
-- Data for Name: department1; Type: TABLE DATA; Schema: public; Owner: -
----
-- TOC entry 3661 (class 0 OID 24611)
-- Dependencies: 215
-- Data for Name: orders; Type: TABLE DATA; Schema: public; Owner: -
----
-- TOC entry 3660 (class 0 OID 24580)
-- Dependencies: 213
-- Data for Name: student; Type: TABLE DATA; Schema: public; Owner: -
--INSERT INTO public.student VALUES (1, 1, 'tname1');
INSERT INTO public.student VALUES (2, 1, 'tname1');
INSERT INTO public.student VALUES (3, 2, 'tname2');
INSERT INTO public.student VALUES (4, 3, 'tname3');
INSERT INTO public.student VALUES (5, 3, 'tname3');--
-- TOC entry 3663 (class 0 OID 25264)
-- Dependencies: 217
-- Data for Name: t2; Type: TABLE DATA; Schema: public; Owner: -
----
-- TOC entry 3659 (class 0 OID 24577)
-- Dependencies: 212
-- Data for Name: teacher; Type: TABLE DATA; Schema: public; Owner: -
--INSERT INTO public.teacher VALUES (1, 'sname1');
INSERT INTO public.teacher VALUES (2, 'sname2');
INSERT INTO public.teacher VALUES (3, 'sname3');-- Completed on 2023-08-24 08:52:15 CST--
-- PostgreSQL database dump complete
--

6,备份 database

1,对话框:
在这里插入图片描述在这里插入图片描述在这里插入图片描述2,备份信息:

@blueprint.route('/job/<int:sid>', methods=['POST'], endpoint='create_server_job'
)
@blueprint.route('/job/<int:sid>/object', methods=['POST'], endpoint='create_object_job'
)
@login_required
def create_backup_objects_job(sid):"""Args:sid: Server IDCreates a new job for backup task(Backup Database(s)/Schema(s)/Table(s))Returns:None"""# 获取请求# {'file': 'pdb', 'format': 'plain', 'id': None, 'blobs': True, 'verbose': True, 'encoding': 'UTF8', 'role': 'postgres', 'pre_data': True, 'data': True, 'post_data': True, 'dns_owner': True, 'dns_tablespace': True, 'use_insert_commands': True, 'include_create_database': True, 'include_drop_database': True, 'database': 'postgres'}data = json.loads(request.data, encoding='utf-8')# 'objects'backup_obj_type = data.get('type', 'objects')try:# 获取文件路径# '/var/lib/pgadmin/storage/dangfulin2333_163.com/pdb'backup_file = filename_with_file_manager_path(data['file'], (data.get('format', '') != 'directory'))except Exception as e:return bad_request(errormsg=str(e))# 获取服务器信息# <Server 1>server = get_server(sid)if server is None:return make_json_response(success=0,errormsg=_("Could not find the specified server."))# To fetch MetaData for the serverfrom pgadmin.utils.driver import get_driverdriver = get_driver(PG_DEFAULT_DRIVER)manager = driver.connection_manager(server.id)conn = manager.connection()connected = conn.connected()if not connected:return make_json_response(success=0,errormsg=_("Please connect to the server first."))# 获取备份工具# '/usr/lib/postgresql/14/bin/pg_dump'utility = manager.utility('backup') if backup_obj_type == 'objects' \else manager.utility('backup_server')ret_val = does_utility_exist(utility)if ret_val:return make_json_response(success=0,errormsg=ret_val)# 工具参数# ['--file', '/var/lib/pgadmin/storage/dangfulin2333_163.com/pdb', '--host', '127.0.0.1', '--port', '5432', '--username', 'postgres', '--no-password', '--verbose', '--role', 'postgres', '--format=p', '--no-owner', '--create', '--clean', '--section=pre-data', '--section=data', '--section=post-data', '--no-tablespaces', '--inserts', '--encoding', 'UTF8', 'postgres']args = _get_args_params_values(data, conn, backup_obj_type, backup_file, server, manager)# 这里将参数中的所有双引号转义,因为双引号在shell命令行中具有特殊含义,它们在没有双引号的情况下运行。添加额外的引号以保存我们的双引号。# ['--file', '/var/lib/pgadmin/storage/dangfulin2333_163.com/pdb', '--host', '127.0.0.1', '--port', '5432', '--username', 'postgres', '--no-password', '--verbose', '--role', 'postgres', '--format=p', '--no-owner', '--create', '--clean', '--section=pre-data', '--section=data', '--section=post-data', '--no-tablespaces', '--inserts', '--encoding', 'UTF8', 'postgres']escaped_args = [escape_dquotes_process_arg(arg) for arg in args]try:# 用 utf-8 编码文件名bfile = data['file'].encode('utf-8') \if hasattr(data['file'], 'encode') else data['file']# 区分不同的备份类型if backup_obj_type == 'objects':    # 备份数据对象(数据库、模式、表)数据args.append(data['database'])# ['--file', '/var/lib/pgadmin/storage/dangfulin2333_163.com/pdb', '--host', '127.0.0.1', '--port', '5432', '--username', 'postgres', '--no-password', '--verbose', '--role', 'postgres', '--format=p', '--no-owner', '--create', '--clean', '--section=pre-data', '--section=data', '--section=post-data', '--no-tablespaces', '--inserts', '--encoding', 'UTF8', 'postgres']escaped_args.append(data['database'])# ['--file', '/var/lib/pgadmin/storage/dangfulin2333_163.com/pdb', '--host', '127.0.0.1', '--port', '5432', '--username', 'postgres', '--no-password', '--verbose', '--role', 'postgres', '--format=p', '--no-owner', '--create', '--clean', '--section=pre-data', '--section=data', '--section=post-data', '--no-tablespaces', '--inserts', '--encoding', 'UTF8', 'postgres']p = BatchProcess(desc=BackupMessage(BACKUP.OBJECT, server.id, bfile,*args,database=data['database']),cmd=utility, args=escaped_args)else:                               # 备份服务器数据p = BatchProcess(desc=BackupMessage(BACKUP.SERVER if backup_obj_type != 'globals'else BACKUP.GLOBALS,server.id, bfile,*args),cmd=utility, args=escaped_args)manager.export_password_env(p.id)# Check for connection timeout and if it is greater than 0 then# set the environment variable PGCONNECT_TIMEOUT.if manager.connect_timeout > 0:env = dict()env['PGCONNECT_TIMEOUT'] = str(manager.connect_timeout)p.set_env_variables(server, env=env)else:p.set_env_variables(server)# 创建子进程,执行 pg_dump 命令p.start()jid = p.idexcept Exception as e:current_app.logger.exception(e)return make_json_response(status=410,success=0,errormsg=str(e))# Return responsereturn make_json_response(data={'job_id': jid, 'desc': p.desc.message, 'Success': 1})

在这里插入图片描述

3,备份文件:

--
-- PostgreSQL database dump
---- Dumped from database version 14.9 (Ubuntu 14.9-0ubuntu0.22.04.1)
-- Dumped by pg_dump version 14.9 (Ubuntu 14.9-0ubuntu0.22.04.1)-- Started on 2023-08-24 09:06:19 CSTSET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;DROP DATABASE postgres;
--
-- TOC entry 3671 (class 1262 OID 13799)
-- Name: postgres; Type: DATABASE; Schema: -; Owner: -
--CREATE DATABASE postgres WITH TEMPLATE = template0 ENCODING = 'UTF8' LOCALE = 'zh_CN.UTF-8';\connect postgresSET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;--
-- TOC entry 3672 (class 0 OID 0)
-- Dependencies: 3671
-- Name: DATABASE postgres; Type: COMMENT; Schema: -; Owner: -
--COMMENT ON DATABASE postgres IS 'default administrative connection database';--
-- TOC entry 3 (class 3079 OID 24634)
-- Name: btree_gist; Type: EXTENSION; Schema: -; Owner: -
--CREATE EXTENSION IF NOT EXISTS btree_gist WITH SCHEMA public;--
-- TOC entry 3673 (class 0 OID 0)
-- Dependencies: 3
-- Name: EXTENSION btree_gist; Type: COMMENT; Schema: -; Owner: -
--COMMENT ON EXTENSION btree_gist IS 'support for indexing common datatypes in GiST';--
-- TOC entry 2 (class 3079 OID 16394)
-- Name: postgres_fdw; Type: EXTENSION; Schema: -; Owner: -
--CREATE EXTENSION IF NOT EXISTS postgres_fdw WITH SCHEMA public;--
-- TOC entry 3674 (class 0 OID 0)
-- Dependencies: 2
-- Name: EXTENSION postgres_fdw; Type: COMMENT; Schema: -; Owner: -
--COMMENT ON EXTENSION postgres_fdw IS 'foreign-data wrapper for remote PostgreSQL servers';--
-- TOC entry 225 (class 1255 OID 24616)
-- Name: update_order_status(); Type: FUNCTION; Schema: public; Owner: -
--CREATE FUNCTION public.update_order_status() RETURNS triggerLANGUAGE plpgsqlAS $$
BEGINIF NEW.total_amount > 1000 THENNEW.status := '已审核';ELSENEW.status := '待审核';END IF;RETURN NEW;
END;
$$;--
-- TOC entry 2321 (class 2328 OID 16403)
-- Name: test1; Type: FOREIGN DATA WRAPPER; Schema: -; Owner: -
--CREATE FOREIGN DATA WRAPPER test1 HANDLER public.postgres_fdw_handler VALIDATOR public.postgres_fdw_validator;--
-- TOC entry 2322 (class 1417 OID 16401)
-- Name: server1; Type: SERVER; Schema: -; Owner: -
--CREATE SERVER server1 FOREIGN DATA WRAPPER postgres_fdw OPTIONS (dbname 'test',host '172.28.79.200',port '5432'
);--
-- TOC entry 3675 (class 0 OID 0)
-- Name: USER MAPPING postgres SERVER server1; Type: USER MAPPING; Schema: -; Owner: -
--CREATE USER MAPPING FOR postgres SERVER server1 OPTIONS (password 'postgres',"user" 'postgres'
);SET default_table_access_method = heap;--
-- TOC entry 216 (class 1259 OID 24629)
-- Name: circles; Type: TABLE; Schema: public; Owner: -
--CREATE TABLE public.circles (c circle
);--
-- TOC entry 218 (class 1259 OID 25273)
-- Name: company6; Type: TABLE; Schema: public; Owner: -
--CREATE TABLE public.company6 (id integer NOT NULL,name text NOT NULL,age integer NOT NULL,address character(50),salary real
);--
-- TOC entry 219 (class 1259 OID 25280)
-- Name: department1; Type: TABLE; Schema: public; Owner: -
--CREATE TABLE public.department1 (id integer NOT NULL,dept character(50) NOT NULL,emp_id integer NOT NULL
);--
-- TOC entry 211 (class 1259 OID 16405)
-- Name: ft1; Type: FOREIGN TABLE; Schema: public; Owner: -
--CREATE FOREIGN TABLE public.ft1 (port integer
)
SERVER server1;--
-- TOC entry 215 (class 1259 OID 24611)
-- Name: orders; Type: TABLE; Schema: public; Owner: -
--CREATE TABLE public.orders (id integer NOT NULL,order_date date,total_amount numeric(10,2),status character varying(20)
);--
-- TOC entry 213 (class 1259 OID 24580)
-- Name: student; Type: TABLE; Schema: public; Owner: -
--CREATE TABLE public.student (sid integer NOT NULL,teacher_id integer DEFAULT 0 NOT NULL,tname character varying(100)
);--
-- TOC entry 212 (class 1259 OID 24577)
-- Name: teacher; Type: TABLE; Schema: public; Owner: -
--CREATE TABLE public.teacher (id integer NOT NULL,sname character varying(100)
);--
-- TOC entry 214 (class 1259 OID 24584)
-- Name: student_view; Type: VIEW; Schema: public; Owner: -
--CREATE VIEW public.student_view ASSELECT student.sid,student.teacher_id,student.tname,teacher.id,teacher.snameFROM (public.studentLEFT JOIN public.teacher ON ((student.teacher_id = teacher.id)));--
-- TOC entry 217 (class 1259 OID 25264)
-- Name: t2; Type: TABLE; Schema: public; Owner: -
--CREATE TABLE public.t2 (c1 integer,c2 text
);--
-- TOC entry 3662 (class 0 OID 24629)
-- Dependencies: 216
-- Data for Name: circles; Type: TABLE DATA; Schema: public; Owner: -
----
-- TOC entry 3664 (class 0 OID 25273)
-- Dependencies: 218
-- Data for Name: company6; Type: TABLE DATA; Schema: public; Owner: -
----
-- TOC entry 3665 (class 0 OID 25280)
-- Dependencies: 219
-- Data for Name: department1; Type: TABLE DATA; Schema: public; Owner: -
----
-- TOC entry 3661 (class 0 OID 24611)
-- Dependencies: 215
-- Data for Name: orders; Type: TABLE DATA; Schema: public; Owner: -
----
-- TOC entry 3660 (class 0 OID 24580)
-- Dependencies: 213
-- Data for Name: student; Type: TABLE DATA; Schema: public; Owner: -
--INSERT INTO public.student VALUES (1, 1, 'tname1');
INSERT INTO public.student VALUES (2, 1, 'tname1');
INSERT INTO public.student VALUES (3, 2, 'tname2');
INSERT INTO public.student VALUES (4, 3, 'tname3');
INSERT INTO public.student VALUES (5, 3, 'tname3');--
-- TOC entry 3663 (class 0 OID 25264)
-- Dependencies: 217
-- Data for Name: t2; Type: TABLE DATA; Schema: public; Owner: -
----
-- TOC entry 3659 (class 0 OID 24577)
-- Dependencies: 212
-- Data for Name: teacher; Type: TABLE DATA; Schema: public; Owner: -
--INSERT INTO public.teacher VALUES (1, 'sname1');
INSERT INTO public.teacher VALUES (2, 'sname2');
INSERT INTO public.teacher VALUES (3, 'sname3');--
-- TOC entry 3513 (class 2606 OID 24633)
-- Name: circles circles_c_excl; Type: CONSTRAINT; Schema: public; Owner: -
--ALTER TABLE ONLY public.circlesADD CONSTRAINT circles_c_excl EXCLUDE USING gist (c WITH &&);--
-- TOC entry 3515 (class 2606 OID 25279)
-- Name: company6 company6_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--ALTER TABLE ONLY public.company6ADD CONSTRAINT company6_pkey PRIMARY KEY (id);--
-- TOC entry 3517 (class 2606 OID 25284)
-- Name: department1 department1_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--ALTER TABLE ONLY public.department1ADD CONSTRAINT department1_pkey PRIMARY KEY (id);--
-- TOC entry 3511 (class 2606 OID 24615)
-- Name: orders orders_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--ALTER TABLE ONLY public.ordersADD CONSTRAINT orders_pkey PRIMARY KEY (id);--
-- TOC entry 3508 (class 2606 OID 25272)
-- Name: student student_ck; Type: CHECK CONSTRAINT; Schema: public; Owner: -
--ALTER TABLE public.studentADD CONSTRAINT student_ck CHECK ((sid > 0)) NOT VALID;--
-- TOC entry 3676 (class 0 OID 0)
-- Dependencies: 3508
-- Name: CONSTRAINT student_ck ON student; Type: COMMENT; Schema: public; Owner: -
--COMMENT ON CONSTRAINT student_ck ON public.student IS '检查约束';--
-- TOC entry 3518 (class 1259 OID 25290)
-- Name: fki_C; Type: INDEX; Schema: public; Owner: -
--CREATE INDEX "fki_C" ON public.department1 USING btree (emp_id);--
-- TOC entry 3509 (class 1259 OID 24604)
-- Name: index_test; Type: INDEX; Schema: public; Owner: -
--CREATE INDEX index_test ON public.student USING btree (tname COLLATE "C" bpchar_pattern_ops);--
-- TOC entry 3677 (class 0 OID 0)
-- Dependencies: 3509
-- Name: INDEX index_test; Type: COMMENT; Schema: public; Owner: -
--COMMENT ON INDEX public.index_test IS '测试';-- Completed on 2023-08-24 09:06:20 CST--
-- PostgreSQL database dump complete
--

7,备份服务器

1,对话框
在这里插入图片描述在这里插入图片描述
在这里插入图片描述

2,备份信息

@blueprint.route('/job/<int:sid>', methods=['POST'], endpoint='create_server_job'
)
@blueprint.route('/job/<int:sid>/object', methods=['POST'], endpoint='create_object_job'
)
@login_required
def create_backup_objects_job(sid):"""Args:sid: Server IDCreates a new job for backup task(Backup Database(s)/Schema(s)/Table(s))Returns:None"""# 获取请求# {'file': 'localhostserver', 'format': 'plain', 'id': None, 'blobs': False, 'verbose': True, 'encoding': 'UTF8', 'role': 'postgres', 'only_data': True, 'dns_owner': True, 'dns_privilege': True, 'dns_tablespace': True, 'use_insert_commands': True, 'disable_trigger': True, 'disable_quoting': True, 'type': 'server'}data = json.loads(request.data, encoding='utf-8')# 'server'backup_obj_type = data.get('type', 'objects')try:# 获取文件路径# '/var/lib/pgadmin/storage/dangfulin2333_163.com/localhostserver'backup_file = filename_with_file_manager_path(data['file'], (data.get('format', '') != 'directory'))except Exception as e:return bad_request(errormsg=str(e))# 获取服务器信息# <Server 1>server = get_server(sid)if server is None:return make_json_response(success=0,errormsg=_("Could not find the specified server."))# To fetch MetaData for the serverfrom pgadmin.utils.driver import get_driverdriver = get_driver(PG_DEFAULT_DRIVER)manager = driver.connection_manager(server.id)conn = manager.connection()connected = conn.connected()if not connected:return make_json_response(success=0,errormsg=_("Please connect to the server first."))# 获取备份工具# '/usr/lib/postgresql/14/bin/pg_dumpall'utility = manager.utility('backup') if backup_obj_type == 'objects' \else manager.utility('backup_server')ret_val = does_utility_exist(utility)if ret_val:return make_json_response(success=0,errormsg=ret_val)# 工具参数# ['--file', '/var/lib/pgadmin/storage/dangfulin2333_163.com/localhostserver', '--host', '127.0.0.1', '--port', '5432', '--username', 'postgres', '--no-password', '--database', 'postgres', '--verbose', '--role', 'postgres', '--data-only', '--disable-triggers', '--no-owner', '--no-privileges', '--no-tablespaces', '--inserts', '--disable-dollar-quoting', '--encoding', 'UTF8']args = _get_args_params_values(data, conn, backup_obj_type, backup_file, server, manager)# 这里将参数中的所有双引号转义,因为双引号在shell命令行中具有特殊含义,它们在没有双引号的情况下运行。添加额外的引号以保存我们的双引号。# ['--file', '/var/lib/pgadmin/storage/dangfulin2333_163.com/localhostserver', '--host', '127.0.0.1', '--port', '5432', '--username', 'postgres', '--no-password', '--database', 'postgres', '--verbose', '--role', 'postgres', '--data-only', '--disable-triggers', '--no-owner', '--no-privileges', '--no-tablespaces', '--inserts', '--disable-dollar-quoting', '--encoding', 'UTF8']escaped_args = [escape_dquotes_process_arg(arg) for arg in args]try:# 用 utf-8 编码文件名# '/var/lib/pgadmin/storage/dangfulin2333_163.com/localhostserver'bfile = data['file'].encode('utf-8') \if hasattr(data['file'], 'encode') else data['file']# 区分不同的备份类型if backup_obj_type == 'objects':    # 备份数据对象(数据库、模式、表)数据args.append(data['database'])# ['--file', '/var/lib/pgadmin/storage/dangfulin2333_163.com/pdb', '--host', '127.0.0.1', '--port', '5432', '--username', 'postgres', '--no-password', '--verbose', '--role', 'postgres', '--format=p', '--no-owner', '--create', '--clean', '--section=pre-data', '--section=data', '--section=post-data', '--no-tablespaces', '--inserts', '--encoding', 'UTF8', 'postgres']escaped_args.append(data['database'])# ['--file', '/var/lib/pgadmin/storage/dangfulin2333_163.com/pdb', '--host', '127.0.0.1', '--port', '5432', '--username', 'postgres', '--no-password', '--verbose', '--role', 'postgres', '--format=p', '--no-owner', '--create', '--clean', '--section=pre-data', '--section=data', '--section=post-data', '--no-tablespaces', '--inserts', '--encoding', 'UTF8', 'postgres']p = BatchProcess(desc=BackupMessage(BACKUP.OBJECT, server.id, bfile,*args,database=data['database']),cmd=utility, args=escaped_args)else:                               # 备份服务器数据p = BatchProcess(desc=BackupMessage(BACKUP.SERVER if backup_obj_type != 'globals'else BACKUP.GLOBALS,server.id, bfile,*args),cmd=utility, args=escaped_args)manager.export_password_env(p.id)# Check for connection timeout and if it is greater than 0 then# set the environment variable PGCONNECT_TIMEOUT.if manager.connect_timeout > 0:env = dict()env['PGCONNECT_TIMEOUT'] = str(manager.connect_timeout)p.set_env_variables(server, env=env)else:p.set_env_variables(server)# 创建子进程,执行 pg_dump 命令p.start()jid = p.idexcept Exception as e:current_app.logger.exception(e)return make_json_response(status=410,success=0,errormsg=str(e))# Return responsereturn make_json_response(data={'job_id': jid, 'desc': p.desc.message, 'Success': 1})

在这里插入图片描述- 与备份表、schema、database 时使用 dump 不同的是,备份 server 时使用 dumpall

3,备份文件

--
-- PostgreSQL database cluster dump
---- Started on 2023-08-24 09:15:36 CSTSET default_transaction_read_only = off;SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;--
-- Databases
----
-- Database "template1" dump
--\connect template1--
-- PostgreSQL database dump
---- Dumped from database version 14.9 (Ubuntu 14.9-0ubuntu0.22.04.1)
-- Dumped by pg_dump version 14.9 (Ubuntu 14.9-0ubuntu0.22.04.1)-- Started on 2023-08-24 09:15:36 CSTSET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;-- Completed on 2023-08-24 09:15:36 CST--
-- PostgreSQL database dump complete
----
-- Database "postgres" dump
--\connect postgres--
-- PostgreSQL database dump
---- Dumped from database version 14.9 (Ubuntu 14.9-0ubuntu0.22.04.1)
-- Dumped by pg_dump version 14.9 (Ubuntu 14.9-0ubuntu0.22.04.1)-- Started on 2023-08-24 09:15:36 CSTSET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;--
-- TOC entry 3660 (class 0 OID 24629)
-- Dependencies: 216
-- Data for Name: circles; Type: TABLE DATA; Schema: public; Owner: -
--SET SESSION AUTHORIZATION DEFAULT;ALTER TABLE public.circles DISABLE TRIGGER ALL;ALTER TABLE public.circles ENABLE TRIGGER ALL;--
-- TOC entry 3662 (class 0 OID 25273)
-- Dependencies: 218
-- Data for Name: company6; Type: TABLE DATA; Schema: public; Owner: -
--ALTER TABLE public.company6 DISABLE TRIGGER ALL;ALTER TABLE public.company6 ENABLE TRIGGER ALL;--
-- TOC entry 3663 (class 0 OID 25280)
-- Dependencies: 219
-- Data for Name: department1; Type: TABLE DATA; Schema: public; Owner: -
--ALTER TABLE public.department1 DISABLE TRIGGER ALL;ALTER TABLE public.department1 ENABLE TRIGGER ALL;--
-- TOC entry 3659 (class 0 OID 24611)
-- Dependencies: 215
-- Data for Name: orders; Type: TABLE DATA; Schema: public; Owner: -
--ALTER TABLE public.orders DISABLE TRIGGER ALL;ALTER TABLE public.orders ENABLE TRIGGER ALL;--
-- TOC entry 3658 (class 0 OID 24580)
-- Dependencies: 213
-- Data for Name: student; Type: TABLE DATA; Schema: public; Owner: -
--ALTER TABLE public.student DISABLE TRIGGER ALL;INSERT INTO public.student VALUES (1, 1, 'tname1');
INSERT INTO public.student VALUES (2, 1, 'tname1');
INSERT INTO public.student VALUES (3, 2, 'tname2');
INSERT INTO public.student VALUES (4, 3, 'tname3');
INSERT INTO public.student VALUES (5, 3, 'tname3');ALTER TABLE public.student ENABLE TRIGGER ALL;--
-- TOC entry 3661 (class 0 OID 25264)
-- Dependencies: 217
-- Data for Name: t2; Type: TABLE DATA; Schema: public; Owner: -
--ALTER TABLE public.t2 DISABLE TRIGGER ALL;ALTER TABLE public.t2 ENABLE TRIGGER ALL;--
-- TOC entry 3657 (class 0 OID 24577)
-- Dependencies: 212
-- Data for Name: teacher; Type: TABLE DATA; Schema: public; Owner: -
--ALTER TABLE public.teacher DISABLE TRIGGER ALL;INSERT INTO public.teacher VALUES (1, 'sname1');
INSERT INTO public.teacher VALUES (2, 'sname2');
INSERT INTO public.teacher VALUES (3, 'sname3');ALTER TABLE public.teacher ENABLE TRIGGER ALL;-- Completed on 2023-08-24 09:15:36 CST--
-- PostgreSQL database dump complete
---- Completed on 2023-08-24 09:15:36 CST--
-- PostgreSQL database cluster dump complete
--

(二)恢复

1,恢复 table

1,恢复 schema

1,恢复 db

1,恢复 database

三,

四,

五,

六,

(一)

(二)

(四)

(五)

(六)

(七)

(八)

(九)

(十)

(十一)

1,

2,

3,

4,

5,

6,

7,

8,

(1)

(2)

(3)

(4)

(5)

(6)

(7)

(8)

《PostgreSQL 开发指南》第 08 篇 备份与恢复

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/53325.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

GIT 常用指令

基础指令 $ git init #初始化仓库&#xff0c;在该文件夹创建的为workspace$ git add . #已暂存 [.通配符&#xff0c;全部添加]$ git commit -m "log add file" #提交到仓库,并写了日志 ”log add file“$ git status #查看状态&#xff0c;可查看被修改的文件…

Prometheus+Grafana+AlertManager监控SpringBoot项目并发送邮件告警通知

文章目录 PrometheusGrafanaAlertManager监控平台搭建新建SpringBoot项目为Prometheus提供指标新建项目&#xff0c;引入依赖新建接口&#xff0c;运行程序 推送指标到pushgateway 开始监控Grafana连接Prometheus数据源导入Grafana模板监控SpringBoot项目 邮件告警通知同系列文…

Windows如何部署Redis

一、简介 Redis (Remote Dictionary Server) 是一个由意大利人 Salvatore Sanfilippo 开发的 key-value 存储系统&#xff0c;具有极高的读写性能&#xff0c;读的速度可达 110000 次/s&#xff0c;写的速度可达 81000 次/s 。 二、下载 访问 https://github.com/tporadows…

字符串经典问题

1. 验证回文串 验证回文串 如果在将所有大写字符转换为小写字符、并移除所有非字母数字字符之后&#xff0c;短语正着读和反着读都一样。则可以认为该短语是一个 回文串 。 字母和数字都属于字母数字字符。 给你一个字符串 s&#xff0c;如果它是 回文串 &#xff0c;返回 t…

Vue2向Vue3过度核心技术computed计算属性

目录 1 computed计算属性1.1 概念1.2 语法1.3 注意1.4.案例1.5.代码准备 2 computed计算属性 VS methods方法2.1 computed计算属性2.2 methods计算属性2.3 计算属性的优势2.4 总结 3 计算属性的完整写法 1 computed计算属性 1.1 概念 基于现有的数据&#xff0c;计算出来的新属…

探索AIGC人工智能(Midjourney篇)(一)

文章目录 案例图片 Midjourney注册 创建Discord账号 下载客户端 添加Midjourney到自己的服务器 用Midjourney画一只会飞的鸭子 Midjourney绘画指令 Midjourney绘画指令_激发Midjourney的创造力 Midjourney绘画指令_Seed指令 Midjourney光线关键词&#xff0c;打造震撼…

XGBoost,NVIDIA是什么

目录 XGBoost 算法层面 什么是 XGBoost GBDT是什么 GBDT中的GB 为何选择 XGBoost&#xff1f; XGBoost 的优势和属性 XGBoost 和数据科学家 为何 XGBoost 在 GPU 上表现更出色 XGBoost RAPIDS GPU 加速的 XGBoost NVIDIA是什么 使用 Spark XGBoost 的 GPU 加速端…

晨控CK-GW208与三菱L系列PLC以TCP通讯手册

晨控CK-GW208是一款支持标准工业以太网协议的IO-LINK主站网关&#xff0c;方便用户快速便捷的集成到 PLC 等控制系统中。 CK-GW208主站网关集成 8 路 IO-LINK 通信端口&#xff0c;采用即插即用模式&#xff0c;无需繁琐的配置&#xff0c;减轻现场安装调试的工作量。为了满足…

如何撰写具有传播力的品牌软文?

企业为了能将自己的品牌宣传推广出去&#xff0c;不论是在品牌初创还是成熟阶段都会撰写很多的新闻软文稿件发布在各大媒体平台上&#xff0c;为的就是能起到持续宣传和影响的效果&#xff01; 软文不但要求短小精悍&#xff0c;更注重内容的精准。不管是什么类型的文章&#…

POSTGRESQL 如何用系统函数来诊断权限问题

开头还是介绍一下群&#xff0c;如果感兴趣polardb ,mongodb ,mysql ,postgresql ,redis 等有问题&#xff0c;有需求都可以加群群内有各大数据库行业大咖&#xff0c;CTO&#xff0c;可以解决你的问题。加群请联系 liuaustin3 &#xff0c;在新加的朋友会分到2群&#xff08;共…

2023MySQL+MyBatis知识点整理

文章目录 主键 外键 的区别&#xff1f;什么是范式&#xff1f;什么是反范式&#xff1f;什么是事务&#xff1f;MySQL事务隔离级别&#xff1f;MySQL事务默认提交模式&#xff1f;MySQL中int(1)和int(10)的区别MySQL 浮点数会丢失精度吗&#xff1f;MySQL支持哪几种时间类型&a…

springcloud3 GateWay章节-Nacos+gateway动态路由负载均衡4

一 工程结构 1.1 工程 1.2 搭建gatewayapi工程 1.pom文件 <dependency><groupId>junit</groupId><artifactId>junit</artifactId><version>4.13</version><scope>test</scope></dependency><!--gateway--&g…

复习之web服务器--apache

PS&#xff1a;Vim复制小技巧 一、实验环境 两台虚拟机 (nodea,nodeb)配置ip搭建软件仓库关闭selinux [rootftp Desktop]# hostnamectl set-hostname nodea.westos.org [rootftp Desktop]# hostname nodea.westos.org [rootftp Desktop]# ifconfig enp1s0: flags4163<UP,B…

大数据开发要学习什么?学完又能做什么

学习大数据需要掌握什么语言基础&#xff1f; 1、Java基础 大数据框架90%以上都是使用Java开发语言&#xff0c;所以如果要学习大数据技术&#xff0c;首先要掌握Java基础语法以及JavaEE方向的相关知识。 2、MySQL数据库 这是学习大数据必须掌握的知识之一。数据的操作语言是…

Vue2向Vue3过度核心技术组件通信

目录 1 组件基础知识scoped解决样式冲突1.1 默认情况&#xff1a;1.2 代码演示1.3 scoped原理1.4 总结 2 组件基础知识data必须是一个函数2.1 data为什么要写成函数2.2 代码演示2.3 总结 3 组件通信3.1 什么是组件通信&#xff1f;3.2 组件之间如何通信3.3 组件关系分类3.4 通信…

为什么使用Nacos而不是Eureka(Nacos和Eureka的区别)

文章目录 前言一、Eureka是什么&#xff1f;二、Nacos是什么&#xff1f;三、Nacos和Eureka的区别3.1 支持的CAP3.2连接方式3.3 服务异常剔除3.4 操作实例方式 总结 前言 为什么如今微服务注册中心用Nacos相对比用Eureka的多了&#xff1f;本文章将介绍他们之间的区别和优缺点…

【element-ui】el-dialog改变宽度

dialog默认宽度为父元素的50%&#xff0c;这就导致在移动端会非常的窄&#xff0c;如图1&#xff0c;需要限定宽度。 解决方法&#xff1a;添加custom-class属性&#xff0c;然后在style中编写样式&#xff0c;注意&#xff0c;如果有scoped限定&#xff0c;需要加::v-deep &l…

浅谈Spark的RDD、部署模式

一、RDD Spark RDD&#xff08;弹性分布式数据集&#xff09;&#xff0c;弹性是指Spark可以通过重新计算来自动重建丢失的分区。 从本质上讲&#xff0c;RDD 是数据元素的不可变分布式集合&#xff0c;跨集群中的节点进行分区&#xff0c;可以与提供转换和操作的低级 API 并行…

到目前为止,所有的关于安卓14的详细介绍

安卓14现在可能已经不远了,谷歌已经进行了五次测试,通常10月份的发布窗口时间很快就会到来。但除了在谷歌I/O 2023上进行简短讨论外,谷歌对正在发生的变化相对沉默。 可以肯定地说,Android 14不会是操作系统有史以来最大的一系列变化,但有很多改进和变化可以让Android保持…

【计算机网络】HTTPs 传输流程

HTTPS和HTTP的区别 1、HTTP协议传输的数据都是未加密的&#xff0c;是明文的&#xff0c;使用HTTP协议传输隐私信息非常不安 HTTPS协议是由SSLHTTP协议构建的可进行加密传输、身份认证的网络协议&#xff0c;要比http协议安全。 2、HTTPS协议需要到CA申请证书&#xff0c;一般…