<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Postgres on 村边的池塘</title>
    <link>https://jerrywang1981.github.io/categories/postgres/</link>
    <description>Recent content in Postgres on 村边的池塘</description>
    <generator>Hugo</generator>
    <language>zh-CN</language>
    <lastBuildDate>Fri, 11 Sep 2020 15:14:50 +0800</lastBuildDate>
    <atom:link href="https://jerrywang1981.github.io/categories/postgres/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Postgres 备份与恢复</title>
      <link>https://jerrywang1981.github.io/post/db/postgres-backup-and-restore/</link>
      <pubDate>Fri, 11 Sep 2020 15:14:50 +0800</pubDate>
      <guid>https://jerrywang1981.github.io/post/db/postgres-backup-and-restore/</guid>
      <description>背景 有时候我们需要备份 schema或者包括数据，然后恢复到另外一个postgres db中。 备份 可以使用 pg_dump 来备份，或者加上 &amp;ndash;schema-only 只备份schema. pg_dump --file &amp;#34;/root/repo/uat-copy.tar&amp;#34; --host &amp;#34;db host name&amp;#34; --port &amp;#34;23123&amp;#34; --username &amp;#34;admin&amp;#34; --password --verbose --format=t --blobs --schema-only &amp;#34;compose&amp;#34; 恢复 同样的，可以使用pg_restore来恢复 pg_restore --host &amp;#34;hostname here&amp;#34; --port &amp;#34;31090&amp;#34; --username &amp;#34;usernamehere&amp;#34; --password --dbname &amp;#34;ibmclouddb&amp;#34; --verbose &amp;#34;/root/repo/uat-copy.tar&amp;#34; 不管备份还是恢复，都会要求输入密</description>
    </item>
    <item>
      <title>Go Gorm 操作数据库</title>
      <link>https://jerrywang1981.github.io/post/go/go-gorm/</link>
      <pubDate>Thu, 23 Jul 2020 08:25:59 +0800</pubDate>
      <guid>https://jerrywang1981.github.io/post/go/go-gorm/</guid>
      <description>Go/Gorm 操作 Postgres 虽然go提供了database/sql包来操作数据库，但是如果有个ORM的包，可以直接操作model来操作数据库，就像node里面的sequelize,是不是 也是挺好的。Gorm就实现了这个功能，这个包目前是github上star数最多的go orm包，包括中文资料，对小伙</description>
    </item>
  </channel>
</rss>
