Colin's Blog
  • Home
  • Github
Subscribe
Tagged

pg_dump

A collection of 2 posts

postgresql

PostgreSQL 使用笔记

初始化数据库: su - postgres -c "initdb --locale en_US.UTF-8 -E UTF8 -D '/var/lib/postgres/data'" 解释:使用 postgres 用户进行登录并切换到该用户的目录,并执行命令:initdb --locale en_US.UTF-8 -E UTF8 -D '/var/lib/postgres/data' 其中参数 -D 指定数据库存放的目录(注:在 Arch Linux 中,postgresql 默认的目录为 /var/lib/

Colin Cheng Apr 6, 2016 • 4 min read
postgresql

pg_restore: [directory archiver] could not open input file "xxx/xxx.dat": Value too large for defined data type

最近将本地的一个数据库搬到 VPS 上,在导入时出现了一个”Value too large for defined data type“的错误。通过 Google 搜索后发现没有实际的解决方案,但大致了解了下(http://www.gnu.org/software/coreutils/faq/coreutils-faq.html#Value-too-large-for-defined-data-type)出错的原因,可能是因为 VPS 的系统是 32bit,而其中需要导入的一个 xxx.dat.gz 文件的太大导致的。 由于在本地使用 pg_dump -Fd 来导出,该选项导出为文件夹,其中数据库的每个表的数据为一个经过 gzip 压缩的文件,后缀为 .dat.gz。该导出方式不能直接通过 psql

Colin Cheng Apr 6, 2016 • 1 min read
Colin's Blog © 2023
Powered by Ghost