postgres-how-to-use

陈志
2023-12-01

参考:https://blog.csdn.net/u011024160/article/details/51372820?locationNum=9&fps=1
转载:
postgresql中可以导出某个sql的执行结果到文件中,方法是在psql中首先执行\o filename,然后执行要导出结果的sql语句即可,可以看到刚刚执行的sql执行结果已经在filename中了。方便,强大,赞!
举个例子:

psql test_db;
\o /tmp/test.out
select username from member where age > 18;

开放端口:
ubuntu ufw
centos firewall-cmd
https://www.jb51.net/os/Ubuntu/617627.html

Ident authentication failed for user “postgres”
https://blog.csdn.net/ohyoyo2014/article/details/24108429

ERROR:
There is 1 other session using the database.
select pg_terminate_backend(pid) from (select pid from pg_stat_activity where datname=‘数据库名’) a;

“root” execution of postgresql server is not permitted
http://www.itkeyword.com/doc/4824124756309341015/root-execution-of-the-postgresql-server-is-not-permitted
sudo -u postgres -i

ERROR:
systemctl 启动错误日志:
pg_ctl: directory “/usr/local/postgres/pgsql/data_pgsql” is not a database cluster directory

 类似资料: