Re: pg_dump save command in output

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Joao Miguel Ferreira <joao(dot)miguel(dot)c(dot)ferreira(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: pg_dump save command in output
Date: 2021-10-03 17:23:19
Message-ID: 0868132e-16d2-2d81-18c5-62cd7dc55666@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 10/3/21 10:15 AM, Joao Miguel Ferreira wrote:
>

> I just wanted to save the command inside the SQL file to be able to
> "remember" it later. ideally I would open the file on some text editor
> and see the original pg_dump command on the few first lines, as a comment
>
> -- original command was: psql -h some_host -p .....
>
>
> Are you dumping in plain or custom format?
>
>
> plain (SQL)

A quick test here found that manually adding:

-- original command was: psql -h some_host -p .....

as:

-- Dumped by pg_dump version XX.x
-- original command was: psql -h some_host -p .....

at head of file did not infer with the restore.

No guarantees though.

>
>
> >
> > thank you
> > Joao
> >
>
>
> --
> Adrian Klaver
> adrian(dot)klaver(at)aklaver(dot)com <mailto:adrian(dot)klaver(at)aklaver(dot)com>
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Shaozhong SHI 2021-10-03 18:16:32 Re: PostgreSQL CHECK Constraint
Previous Message Karsten Hilbert 2021-10-03 17:23:17 Re: pg_dump save command in output