{"id":354,"date":"2021-11-12T07:06:59","date_gmt":"2021-11-12T07:06:59","guid":{"rendered":"https:\/\/randomlinuxnotes.d13.com\/?p=354"},"modified":"2021-11-12T07:06:59","modified_gmt":"2021-11-12T07:06:59","slug":"psql-restore-from-pg_dump-file","status":"publish","type":"post","link":"https:\/\/randomlinuxnotes.d13.com\/?p=354","title":{"rendered":"psql restore from pg_dump file &#8211; invalid command \\N"},"content":{"rendered":"<p>when searching for this error &#8216;invalid command \\N&#8217; when trying to restore my database from a backup I made with the following:<\/p>\n<pre>$ pg_dump -d foo -t bar &gt; bar.psql<\/pre>\n<p>I got lots of suggestions but what I needed was to drop the darn table before restoring it &#8230;<\/p>\n<pre>$psql\nfoo=&gt; drop table bar;\n\n$psql &lt; bar.psql<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>when searching for this error &#8216;invalid command \\N&#8217; when trying to restore my database from a backup I made with the following: $ pg_dump -d foo -t bar &gt; bar.psql I got lots of suggestions but what I needed was to drop the darn table before restoring it &#8230; $psql [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[103,107,109],"class_list":["post-354","post","type-post","status-publish","format-standard","hentry","category-rln","tag-pg_dump","tag-postgres","tag-psql"],"_links":{"self":[{"href":"https:\/\/randomlinuxnotes.d13.com\/index.php?rest_route=\/wp\/v2\/posts\/354","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/randomlinuxnotes.d13.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/randomlinuxnotes.d13.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/randomlinuxnotes.d13.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/randomlinuxnotes.d13.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=354"}],"version-history":[{"count":0,"href":"https:\/\/randomlinuxnotes.d13.com\/index.php?rest_route=\/wp\/v2\/posts\/354\/revisions"}],"wp:attachment":[{"href":"https:\/\/randomlinuxnotes.d13.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=354"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/randomlinuxnotes.d13.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=354"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/randomlinuxnotes.d13.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=354"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}