Re: [HACKERS] Dumping database creation options and ACLs

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: [HACKERS] Dumping database creation options and ACLs
Дата
Msg-id CA+TgmoanhjEzFL1tKuM1X9Nom0HXNLTpi+K9jCe5o_EDPB+0hg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [HACKERS] Dumping database creation options and ACLs  (Adrien Nayrat <adrien.nayrat@dalibo.com>)
Список pgsql-hackers
On Thu, Jun 29, 2017 at 12:30 PM, Adrien Nayrat
<adrien.nayrat@dalibo.com> wrote:
> As reported by Ronan there's no other option than using pg_dumpall to restore
> database options and ACLs.
>
> So, we use this trick to stop pg_dumpall before \connect and then use pg_restore:
>
> pg_dumpall -s | sed -rn '/^\\connect/{q}; p' > database+grants.sql
>
>
> Of course, it is not graceful as we just need results of pg_dumpall -g and what
> the dumpCreateDB() function outputs.
>
> What do you think about adding an option like --createdb-only (as suggested by
> Ronan) for this?  I'm not fully satisfied with this name though, I'll be happy
> if you have a better suggestion.
>
> Attached a naive patch.

Note that some progress has been made on the CURRENT_DATABASE thing:

https://www.postgresql.org/message-id/CAF3+xM+xSswcWQZMP1cjj12gPz8DXHcM9_fT1y-0fVzxi9pmOw@mail.gmail.com

I tend to favor that approach myself, although one point in favor of
your suggestion is that adding another flag to pg_dumpall is a heck of
a lot less work to get to some kind of solution to this issue.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Dilip Kumar
Дата:
Сообщение: Re: [HACKERS] Default Partition for Range
Следующее
От: "K S, Sandhya (Nokia - IN/Bangalore)"
Дата:
Сообщение: Re: [HACKERS] Postgres process invoking exit resulting in sh-QUITcore