Re: pg_dump not dumping default_text_search_config WAI? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: pg_dump not dumping default_text_search_config WAI?
Date
Msg-id 1652071.1762704211@sss.pgh.pa.us
Whole thread Raw
In response to Re: pg_dump not dumping default_text_search_config WAI?  (Philip Warner <pjw@rhyme.com.au>)
Responses Re: pg_dump not dumping default_text_search_config WAI?
List pgsql-hackers
Philip Warner <pjw@rhyme.com.au> writes:
> On 2025-11-09 04:06, Tom Lane wrote:
>> IIRC you'd need to use --create to prod pg_dump to produce
>> a CREATE DATABASE command as well as any database-level
>> ALTER commands.

> Is that a good approach?

Well, it's what pg_dump has always done, at least since it inherited
that work from pg_dumpall (which was even less flexible).

It's not that easy/safe to do it differently.  Without --create,
pg_dump is not chartered to make a new database but only to restore
into whatever DB you've connected to.  So the present approach of
issuing "ALTER DATABASE foo" commands would be completely wrong.
This could be solved if we had some kind of "ALTER CURRENT DATABASE"
command, but we don't.

Plus there's the question of how the results would interact with
any existing DB-level settings.  I'm not really sure that issuing
such commands against a pre-existing DB is a good idea ...

            regards, tom lane



pgsql-hackers by date:

Previous
From: Mihail Nikalayeu
Date:
Subject: Re: isolation tester limitation in case of multiple injection points in a single command
Next
From: Mihail Nikalayeu
Date:
Subject: Re: Revisiting {CREATE INDEX, REINDEX} CONCURRENTLY improvements