A. Extract backup from file backup
1. Backup full database
pg_dump teguhth > teguhth_singledb.sql
2. extract table only specific table (example barang)
---yang benar
sed -n '/-- Name: barang; Type: TABLE; Schema: public; Owner: postgres/,/ALTER TABLE public.barang OWNER TO postgres;/p' teguhth_singledb.sql > barang_filtered.sql
sed -n '/-- Name: barang barang_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres/,/);/p' teguhth_singledb.sql >> barang_filtered.sql
sed -n '/-- Data for Name: barang; Type: TABLE DATA; Schema: public; Owner: postgres/,/\\\./p' teguhth_singledb.sql >> barang_filtered.sql