zsh壳,oh-my-zsh框架,zsh的配置postgresql。我注意到一个恼人的行为:查询数据库时,例如:
SELECT * FROM mytable ;
Run Code Online (Sandbox Code Playgroud)
它的行为与less(with (END)) 一样,返回需要“关闭” less(使用q快捷方式),这意味着我在键入下一个查询时无法读取上一个查询的结果。
相反,bash这种行为不是吗:查询后,显示结果,并且可以键入下一个查询。
我怎样才能定制zsh它在这方面的表现bash?
我尝试使用以下命令在 fedora 上安装 libpq-dev:
sudo dnf install libpq-dev
Run Code Online (Sandbox Code Playgroud)
但结果是:
No match for argument: libpq-dev
Error: Unable to find a match: libpq-dev
Run Code Online (Sandbox Code Playgroud) 从 postgres 网站获取证书密钥时,我开始遇到错误:
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
#6 0.310 --2021-10-04 20:56:35-- https://www.postgresql.org/media/keys/ACCC4CF8.asc
#6 0.315 Resolving www.postgresql.org (www.postgresql.org)... 87.238.57.232, 72.32.157.230, 217.196.149.50, ...
#6 0.318 Connecting to www.postgresql.org (www.postgresql.org)|87.238.57.232|:443... connected.
#6 0.902 ERROR: The certificate of 'www.postgresql.org' is not trusted.
#6 0.902 ERROR: The certificate of 'www.postgresql.org' has expired.
Run Code Online (Sandbox Code Playgroud)
我尝试使用 来解决这个问题--no-check-certificate,但是在安装 postgres 库时遇到了不同的问题:
apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y \
postgresql-client-common postgresql-client-13 \
&& rm -rf /var/lib/apt/lists/*
#9 2.579 404 Not Found [IP: …Run Code Online (Sandbox Code Playgroud) 我在 CentOS 5 x86_64 VPS 中安装了 PostgreSQL 9.1,使用以下命令:
我指定了要安装哪个 Postgresql 版本,所以我选择 9.1,因为我想将开发环境和生产环境等同起来:
wget http://yum.pgrpms.org/9.1/redhat/rhel-5-x86_64/pgdg-centos91-9.1-4.noarch.rpm
Run Code Online (Sandbox Code Playgroud)
进而
yum install postgresql91-server
Run Code Online (Sandbox Code Playgroud)
最后
service postgresql-9.1 initdb
chkconfig postgresql-9.1 on
service postgresql-9.1 start
Run Code Online (Sandbox Code Playgroud)
完成所有这些并创建我的数据库后,我运行psql myfirstdb并收到此警告:
Welcome to psql 8.1.23 (server 9.1.11), the PostgreSQL interactive terminal.
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit
WARNING: You are connected to a server with major version …Run Code Online (Sandbox Code Playgroud) 这是关于 Metasploit 框架。
root@kali:~# service postgresql start
[....] Starting PostgreSQL 9.1 database server: main[....] The
PostgreSQL server failed to start. Please check the log output:
2015-05-23 19:07:58 EDT LOG: database system was interrupted;
last known up at 2015-05-23 16:52:00 EDT 2015-05-23 19:07:58
EDT FATAL: could not open file "/etc/ssl/certs/ssl-cert-snakeoil.pem":
Permission denied 2015-05-23 19:07:58 EDT LOG: startup process
(PID 3466) exited with exit code 1 2015-05-23 19:07:58 EDT LOG:
aborting startup due to startup [FAILss failure ... failed! failed!
Run Code Online (Sandbox Code Playgroud)
我的第一个问题是,PostgreSQL 运行良好。是什么事情突然触发了这个问题? …
我想测试在查询超时的情况下对 PostgreSQL 服务器执行查询的程序的行为。
我怎么能模拟呢?
以 pgsql 用户身份登录
键入以下命令:
$ su - pgsql
Run Code Online (Sandbox Code Playgroud)
获取要备份的数据库列表:
$ psql -l
Run Code Online (Sandbox Code Playgroud)
我选择了用户数据库
输入以下命令
$ pg_dump users > users.dump.out
Run Code Online (Sandbox Code Playgroud)
好的,我在哪里可以找到 users.dump.out ?,我需要在其他服务器上使用该备份。
我已经创建了我的第一个 postgres 表,我正在尝试研究如何将 .csv 文件复制到表中,同时在第 1 列(ID)中生成一个序列号,该序列号从数字 1 开始向上计数(即1, 2 ,3 等)每行。我一直在使用命令:
COPY sales_table FROM '/home/perl_experiments/xmlcsv.txt' (DELIMITER('|'));
Run Code Online (Sandbox Code Playgroud)
这试图复制 csv 的内容,但它似乎将 .csv 中的第一列数据放入表的第一列。我已将表的第一列指定为 bigserial,我假设该列会自动填充,而 csv 的内容将绕过第 1 列并从第 2 列开始填充表。显然情况并非如此,我有错过了至关重要的一步。任何人都可以对我错过的步骤有所了解吗?这是我创建的表的摘要:
Column Type Not Null Default
ID bigint NOT NULL nextval('"sales_table_Entry Id_seq"'::regclass) [pk]
ProdNo bigint
Title character varying
url character varying
Price integer
Run Code Online (Sandbox Code Playgroud) 我已经安装的Postgres在Ubuntu 16.04 9.5它创建postgresql.service和postgresql@.service。
我知道postgresql.service生成所有启用的 postgres 实例,我可以调用一个特定的实例,postgresql@9.5-main但它postgresql@.service是一个模板文件,我看不到实例字符串(由模板中的 %i 或 %I 表示)所在的任何地方被路过postgresql.service。
如何postgresql.service知道启用了哪些实例,以及如何将它们传递给 systemd 模板文件?
我试图在 CentOS7 上安装 postgresql11。我在官网找到了安装说明:https : //www.postgresql.org/download/linux/redhat/
然后我按照它的步骤并选择以下参数:
1.version: 11
2.platform: RedHat Enterprise,CentOS, Scientific or Oracle version 7
3.architecture: x86_64
Run Code Online (Sandbox Code Playgroud)
得到安装 resository RPM 的命令:
yum install https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
Run Code Online (Sandbox Code Playgroud)
我在服务器上运行成功。然后我尝试运行安装客户端软件包的命令:
yum install postgresql11
Run Code Online (Sandbox Code Playgroud)
执行此命令时出现以下错误:
File contains parsing errors: file:///etc/yum.repos.d/pgdg-redhat-all.repo
[line 196]: [pgdg96-updates-debuginfo]k
[line 203]: [pgdg95-updates-debuginfo]k
Run Code Online (Sandbox Code Playgroud)
当我尝试删除这个包使用命令时,我遇到了同样的错误:
yum erase pgdg-redhat-repo
Run Code Online (Sandbox Code Playgroud)
我在 /etc/yum.repos.d use 命令中找不到任何内容:
cd /etc/yum.repos.d/ && grep pgdg-redhat-all.repo ./*
Run Code Online (Sandbox Code Playgroud)
我已经在谷歌搜索过这个错误,似乎没有人遇到过这个错误。有谁知道如何解决这个问题?
postgresql ×10
centos ×2
database ×2
c ×1
certificates ×1
csv ×1
dnf ×1
fedora ×1
kali-linux ×1
less ×1
linux ×1
ssl ×1
systemd ×1
timeout ×1
zsh ×1