PostgreSQL dump 文件导入:Ubuntu

记录如何将数据导入到 PostgreSQL

PSQL基本命令: https://www.jianshu.com/p/8515a02492f1

 ==========================

Found error:  psql: FATAL: Peer authentication failed for user "postgres"  https://stackoverflow.com/questions/18664074/getting-error-peer-authentication-failed-for-user-postgres-when-trying-to-ge

The problem is still your pg_hba.conf file (/etc/postgresql/10/main/pg_hba.conf*).

After altering this file, don't forget to restart your PostgreSQL server. If you're on Linux, that would be sudo service postgresql restart.

==========================

查询数据库------------

psql -U postgres -d gaia

select * from public."yourTablename" limit 10;

public is the schema of your table.

=========================

显示文件前3行:head -3 minicom.log

Use vim to modify the sql file : replace the schema with public

Copy the data: psql -U postgres -d gaia -f XXX.sql

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容