Re: BUG #15181: pg_dump - missing schema in CREATE TEXT SEARCH DICTIONARY

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: adam(dot)bartoszewicz(at)gmail(dot)com
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #15181: pg_dump - missing schema in CREATE TEXT SEARCH DICTIONARY
Date: 2018-04-30 15:30:25
Message-ID: 11813.1525102225@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

=?utf-8?q?PG_Bug_reporting_form?= <noreply(at)postgresql(dot)org> writes:
> CREATE TEXT SEARCH DICTIONARY polish_thesaurus (
> TEMPLATE = thesaurus,
> DictFile = polish, -- tsearch_data/polish.ths
> Dictionary = polish_ispell
> );

> The bug ocurs when I try to dump and reload database structure.
> pg_dump creates command with missing schema:
> CREATE TEXT SEARCH DICTIONARY public.polish_thesaurus (
> TEMPLATE = pg_catalog.thesaurus,
> dictfile = 'polish', dictionary = 'polish_ispell' );

Hm. There is not a lot that pg_dump can do about that: it's really
a design shortcoming in the thesaurus template, namely that the
sub-dictionary is referenced by a string rather than by OID. You could
break it equally well with "ALTER TEXT SEARCH DICTIONARY polish_ispell
RENAME ...", or for that matter by trying to use polish_thesaurus in any
context where you didn't have the public schema in your search path.

I'd recommend explicitly specifying "Dictionary = public.polish_ispell"
when you create the thesaurus dictionary.

I suppose we should adjust the docs to point out this hazard, as well.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Adam Bartoszewicz 2018-04-30 15:53:34 Re: BUG #15181: pg_dump - missing schema in CREATE TEXT SEARCH DICTIONARY
Previous Message PG Bug reporting form 2018-04-30 15:02:50 BUG #15181: pg_dump - missing schema in CREATE TEXT SEARCH DICTIONARY