postgresql

华为鲲鹏HCIA认证笔记总结四(复习考点附题库)

China☆狼群 提交于 2021-02-04 17:57:25
道阻且长,行则将至。埋头苦干,不鸣则已,一鸣惊人!加油,骚年! 文章目录 1 参考资料 2 笔记总结 2.1 华为鲲鹏 2.2 TaiShan 服务器 2.3 华为云鲲鹏云服务 2.4 openEuler 2.5 鲲鹏处理器与 X86 处理器的指令差异 2.6 编译型语言 & 解释型语言 2.7 移植选项 2.8 华为鲲鹏代码迁移工具 2.9 容器与虚拟机 2.10 Docker 2.11 TPCC 2.12 BenchmarkSQL 2.13 HiBench 2.14 HPC 性能测试 2.15 性能调优分析工具 2.16 NUMA 2.17 镜像 2.18 系统盘 2.19 弹性公网 IP 2.20 BGP 类型 2.21 编译 2.22 Linux 安装软件 2.23 RPMbuild 2.24 华为云发布的鲲鹏行业解决方案 2.25 思考题 3 题库分享 3.1 资源获取 3.2 模拟考试 4 结尾祝福 1 参考资料   在准备考试过程中,参考了很多资料,非常感谢各位前辈的帮助。整理资料链接如下: 【鲲鹏HCIA考试】错题集(https://blog.csdn.net/qq_44745905/article/details/108725463) 鲲鹏云HCIA知识总结(一)(https://blog.csdn.net/qq_43531669/article/details

Psycopg2 db connection hangs on lost network connection

痞子三分冷 提交于 2021-02-04 17:10:02
问题 Problem description I'm using psycopg2 to connect to my PostgreSQL database on a remote host. I open a connection and wait for requests, then for each request I run queries on the connection and return data. But when the network connection is lost after the connection is already open the next db query hangs and I have to kill the program manually. Details: it hangs for at least 2 hours (I couldn't wait longer) the "network down" situation is actually VPN going down (db host is accesible only

Psycopg2 db connection hangs on lost network connection

梦想与她 提交于 2021-02-04 17:06:34
问题 Problem description I'm using psycopg2 to connect to my PostgreSQL database on a remote host. I open a connection and wait for requests, then for each request I run queries on the connection and return data. But when the network connection is lost after the connection is already open the next db query hangs and I have to kill the program manually. Details: it hangs for at least 2 hours (I couldn't wait longer) the "network down" situation is actually VPN going down (db host is accesible only

Psycopg2 db connection hangs on lost network connection

巧了我就是萌 提交于 2021-02-04 17:05:42
问题 Problem description I'm using psycopg2 to connect to my PostgreSQL database on a remote host. I open a connection and wait for requests, then for each request I run queries on the connection and return data. But when the network connection is lost after the connection is already open the next db query hangs and I have to kill the program manually. Details: it hangs for at least 2 hours (I couldn't wait longer) the "network down" situation is actually VPN going down (db host is accesible only

How do I call a database function using SQLAlchemy in Flask?

非 Y 不嫁゛ 提交于 2021-02-04 15:13:28
问题 I want to call a function that I created in my PostgreSQL database. I've looked at the official SQLAlchemy documentation as well as several questions here on SO, but nobody seems to explain how to set up the function in SQLAlchemy. I did find this question, but am unsure how to compile the function as the answer suggests. Where does that code go? I get errors when I try to put this in both my view and model scripts. Edit 1 (8/11/2016) As per the community's requests and requirements, here are

Deleted PostgreSQL user from mac, how to restore?

烂漫一生 提交于 2021-02-04 14:12:43
问题 I did something really stupid. I was running a postgreSQL on my mac, with a few databases in it. Recently I noticed a new user called PostgreSQL was added at my login screen, and I didn't find a better idea to remove this user. Now, my pgAdminIII doesn't connect to the server anymore, giving this error when I try to connect: Server doesn't listen The server doesn't accept connections: the connection library reports could not connect to server: Connection refused Is the server running on host

PostgreSQL functions and triggers

孤街醉人 提交于 2021-02-04 13:38:25
问题 I am trying out functions and triggers int postgreSQL, however i am having a problem, when the function is triggered it is giving me an error ERROR: control reached end of trigger procedure without RETURN this particular procedure is only executing an insert into command so i do not see why it needs a return this is the script: CREATE OR REPLACE FUNCTION forest_aud_func() returns trigger as $tree_stamp$ BEGIN insert into Audit values('k',124,'l'); END; $tree_stamp$ LANGUAGE plpgsql; create

Adapt an existing database to a django app

陌路散爱 提交于 2021-02-04 13:22:06
问题 I have a Postgresql databese with data. I want to create a django app with that database. How can i import the tables to django models and/or views? 回答1: There is a utility called manage.py inspectdb to generate models from your existing database. It works pretty well. $ python manage.py inspectdb > models.py 回答2: If your database is not very simple -- or very well designed -- you'll find it a poor fit with Django. While the reverse engineering works well, you may find that the original

Docker - Postgres and pgAdmin 4 : Connection refused

和自甴很熟 提交于 2021-02-04 13:16:28
问题 Newbie with docker, I am trying to connect throught localhost my pgAdmin container to the postgres one. CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 0b00555238ba dpage/pgadmin4 "/entrypoint.sh" 43 minutes ago Up 43 minutes 0.0.0.0:80->80/tcp, 443/tcp pedantic_turing e79fb6440a95 postgres "docker-entrypoint.s…" About an hour ago Up About an hour 0.0.0.0:5432->5432/tcp pg-docker I succeed connecting with psql command. psql -h localhost -U postgres -d postgres But when I create the

How to speed up spark df.write jdbc to postgres database?

最后都变了- 提交于 2021-02-04 12:16:14
问题 I am new to spark and am attempting to speed up appending the contents of a dataframe, (that can have between 200k and 2M rows) to a postgres database using df.write: df.write.format('jdbc').options( url=psql_url_spark, driver=spark_env['PSQL_DRIVER'], dbtable="{schema}.{table}".format(schema=schema, table=table), user=spark_env['PSQL_USER'], password=spark_env['PSQL_PASS'], batchsize=2000000, queryTimeout=690 ).mode(mode).save() I tried increasing the batchsize but that didn't help, as