pg_dump run via windows command prompt

0

I executed a dump with the following script:

C:\Arquivos de Programas\postgresql\bin>pg_dump.exe -h xxx.xxx.xxx.xxx -p 5432 -U postgres -W postgres
Senha:...

-- PostgreSQL database dump
--

-- Dumped from database version 10.1
-- Dumped by pg_dump version 10.1

SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET row_security = off;

--
-- Name: postgres; Type: COMMENT; Schema: -; Owner: postgres
--

COMMENT ON DATABASE postgres IS 'default administrative connection database';


--
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner:
--

CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;


--
-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner:
--

COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';


--
-- Name: adminpack; Type: EXTENSION; Schema: -; Owner:
--

CREATE EXTENSION IF NOT EXISTS adminpack WITH SCHEMA pg_catalog;


--
-- Name: EXTENSION adminpack; Type: COMMENT; Schema: -; Owner:
--

COMMENT ON EXTENSION adminpack IS 'administrative functions for PostgreSQL';


--
-- PostgreSQL database dump complete
--

My question is, if the backup was executed, where is the file?

    
asked by anonymous 28.02.2018 / 16:14

1 answer

1

You did not enter the -f parameter by specifying the file, the dump was only displayed at the prompt, and not saved.

The correct command would be:

C:\Arquivos de Programas\postgresql\bin>pg_dump.exe -h xxx.xxx.xxx.xxx -p 5432 -U postgres -f C:\backup\meudump.dump database_nome

There is a response from me here: link showing how to perform the dump.

pg_dump documentation: link

    
28.02.2018 / 17:25