Обсуждение: Proper format for pg_dump file date

Поиск
Список
Период
Сортировка

Proper format for pg_dump file date

От
Rich Shepard
Дата:
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



Re: Proper format for pg_dump file date

От
Adrian Klaver
Дата:
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




Re: Proper format for pg_dump file date [RESOLVED]

От
Rich Shepard
Дата:
On Wed, 19 Jun 2024, Adrian Klaver wrote:

> That is your choice, whatever makes sense to you.

Thank you, Adrian.

Regards,

Rich



Re: Proper format for pg_dump file date

От
"David G. Johnston"
Дата:
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.

Re: Proper format for pg_dump file date

От
Rich Shepard
Дата:
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



Re: Proper format for pg_dump file date

От
Ron Johnson
Дата:
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".)

Re: Proper format for pg_dump file date

От
Ron Johnson
Дата:
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).

Re: Proper format for pg_dump file date

От
Rich Shepard
Дата:
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