Обсуждение: Proper format for pg_dump file date
Is the correct date format for pg_dump <filename>-$(date +%Y-%m-%d).sql or <filename>-YYYY-MM-DD.sql or something else? TIA, Rich
On 6/19/24 08:55, Rich Shepard wrote: > Is the correct date format for pg_dump > <filename>-$(date +%Y-%m-%d).sql > or > <filename>-YYYY-MM-DD.sql > or something else? That is your choice, whatever makes sense to you. > > TIA, > > Rich > > -- Adrian Klaver adrian.klaver@aklaver.com
On Wed, 19 Jun 2024, Adrian Klaver wrote: > That is your choice, whatever makes sense to you. Thank you, Adrian. Regards, Rich
On Wed, Jun 19, 2024 at 8:55 AM Rich Shepard <rshepard@appl-ecosys.com> wrote:
Is the correct date format for pg_dump
<filename>-$(date +%Y-%m-%d).sql
or
<filename>-YYYY-MM-DD.sql
or something else?
If you are doing a custom format dump using .sql as the extension is objectively wrong. it is correct if you are doing an sql dump, but those are generally best avoided.
David J.
On Wed, 19 Jun 2024, David G. Johnston wrote: > If you are doing a custom format dump using .sql as the extension is > objectively wrong. it is correct if you are doing an sql dump, but those > are generally best avoided. David, I use the default text format so restoration is by psql. Rich
On Wed, Jun 19, 2024 at 11:55 AM Rich Shepard <rshepard@appl-ecosys.com> wrote:
Is the correct date format for pg_dump
<filename>-$(date +%Y-%m-%d).sql
or
<filename>-YYYY-MM-DD.sql
"Click select" stops at dash in some ssh clients, but not in others. That's what drives my decision making.
(Also, "%F" is equivalent to "%Y-%m-%d".)
On Wed, Jun 19, 2024 at 1:14 PM Rich Shepard <rshepard@appl-ecosys.com> wrote:
On Wed, 19 Jun 2024, David G. Johnston wrote:
> If you are doing a custom format dump using .sql as the extension is
> objectively wrong. it is correct if you are doing an sql dump, but those
> are generally best avoided.
David,
I use the default text format so restoration is by psql.
Perfectly valid for small databases, and copying tables from one instance to another (though in that case, consider postgres_fdw).
On Wed, 19 Jun 2024, Ron Johnson wrote: > "Click select" stops at dash in some ssh clients, but not in others. > That's what drives *my* decision making. > > (Also, "%F" is equivalent to "%Y-%m-%d".) Thanks, Ron. Rich