Subject: Proper format for pg_dump file date

From: Rich Shepard <[email-masked]>
Date: Wed, 19 Jun 2024 08:55:01 -0700 (PDT)

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

---

From: "David G. Johnston" <[email-masked]>
Date: Wed, 19 Jun 2024 09:14:41 -0700

>         <filename>-YYYY-MM-DD.sql
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.

---

From: Rich Shepard <[email-masked]>
Date: Wed, 19 Jun 2024 10:13:56 -0700 (PDT)

> are generally best avoided.

David,

I use the default text format so restoration is by psql.

Rich

---

From: Ron Johnson <[email-masked]>
Date: Wed, 19 Jun 2024 13:15:07 -0400

>         <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".)

---

From: Rich Shepard <[email-masked]>
Date: Wed, 19 Jun 2024 10:38:24 -0700 (PDT)

> (Also, "%F" is equivalent to "%Y-%m-%d".)

Thanks, Ron.

Rich