{"id":6552,"date":"2018-04-07T11:04:17","date_gmt":"2018-04-07T16:04:17","guid":{"rendered":"http:\/\/www.carnaghan.com\/?post_type=epkb_post_type_1&p=6552"},"modified":"2018-04-07T11:04:17","modified_gmt":"2018-04-07T16:04:17","slug":"how-to-create-a-backup-of-a-postgresql-database-to-a-sql-file","status":"publish","type":"epkb_post_type_1","link":"https:\/\/www.carnaghan.com\/knowledge-base\/how-to-create-a-backup-of-a-postgresql-database-to-a-sql-file\/","title":{"rendered":"How to create a backup of a PostgreSQL database to a SQL file"},"content":{"rendered":"
How to create a\u00a0backup<\/strong>\u00a0of a\u00a0PostgreSQL<\/strong>\u00a0database<\/strong>\u00a0to a\u00a0sql<\/strong>\u00a0file? This\u00a0sql<\/strong>\u00a0file then can be used to\u00a0restore<\/strong>\u00a0the\u00a0database<\/strong>\u00a0on a later stage.<\/p>\n Follow the steps below in order to create a backup<\/p>\n How to create a\u00a0backup\u00a0of a\u00a0PostgreSQL\u00a0database\u00a0to a\u00a0sql\u00a0file? This\u00a0sql\u00a0file then can be used to\u00a0restore\u00a0the\u00a0database\u00a0on a later stage. Follow the steps below in order to create a backup Open a\u00a0Terminal Window\u00a0if not yet in\u00a0command line Login as user postgres.\u00a0eg.\u00a0sudo su postgres\u00a0 Type in the following command pg_dump db_name -CdiOv > \/tmp\/db_name_backup.sql pg_dump\u00a0= Utility to backup a PostgreSQL db. […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":""},"epkb_post_type_1_category":[4427],"epkb_post_type_1_tag":[],"yoast_head":"\n\n
\npg_dump db_name -CdiOv > \/tmp\/db_name_backup.sql<\/span><\/p>\n\n
\nNOTE<\/strong>: PostgreSQL 8.3.7 has been used and installed on Ubuntu 9.04 with this how-to<\/p>\n","protected":false},"excerpt":{"rendered":"