-
Notifications
You must be signed in to change notification settings - Fork 1.1k
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issues with running pg_dump with docker exec? #219
Comments
The message I got with |
+1 |
Sorry for the delay -- I'm not able to reproduce the issue. When I run $ docker exec -i --user postgres test pg_restore < test.dump
--
-- 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';
--
-- PostgreSQL database dump complete
--
|
I'm not sure if you want to close this issue, ran into the same problem today. If I'm Running |
@cuongtranx can you please provide a complete set of minimal example commands to reproduce the issue? |
Sure:
verbose returns the following message: I've tried to create dump as text (without |
That's not a complete example -- how does |
(Apologies. Please ignore previous, deleted comments) I traced this back to using Here's a reproducer: sql.txt |
Sorry for commenting in and old issue but this is the first thread that actually helped me solve a similar problem (I was invoking pg_dump using docker-compose exec). |
Don't know what's going on here but I had to NOT use This is the command that worker for me:
This did not work:
|
Sorry for necroposting, but @elitan I suspect that @RafalSkolasinski above was actually talking about |
Hi, today I noticed a weird behavior when trying to restore a dump from my back-ups to my local machine. pg_restore returned successful but without restoring anything from a 600MB dump. With --verbose it reported data-only was implied but I didn't ask for data-only. I was creating the back-up with
docker exec container-name pg_dump -Fc dbname > /tmp/db.dump
. The dump file was created in the Docker host machine as expected but for some reason I was not able to restore from that dump. If I use an external postgresql-client package in the host, then the dump file works as expected. Isdocker exec
appending anything else to the output that could be causing such bad dump file? Maybe the documentation could add a warning if this is the case. If I knew that beforehand I'd probably added some volume mapping to local back-ups (-v /tmp/db-dumps:/db-dumps
). Anyway, I'm curious. Has someone else experienced such weird behavior? If so, do you know why it doesn't work as expected?The text was updated successfully, but these errors were encountered: