pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedBUG #15181: pg_dump - missing schema in CREATE TEXT SEARCH DICTIONARY
3+ messages / 3 participants
[nested] [flat]
* BUG #15181: pg_dump - missing schema in CREATE TEXT SEARCH DICTIONARY
@ 2018-04-30 15:02 PG Bug reporting form <noreply@postgresql.org>
2018-04-30 15:30 ` Re: BUG #15181: pg_dump - missing schema in CREATE TEXT SEARCH DICTIONARY Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 3+ messages in thread
From: PG Bug reporting form @ 2018-04-30 15:02 UTC (permalink / raw)
To: pgsql-bugs@lists.postgresql.org; +Cc: adam.bartoszewicz@gmail.com
The following bug has been logged on the website:
Bug reference: 15181
Logged by: Adam Bartoszewicz
Email address: adam.bartoszewicz@gmail.com
PostgreSQL version: 9.3.22
Operating system: CentOS 6
Description:
Helo,
I use PostgreSQL v 9.3.22 (enterprisedb.com installer), CentOS 6
I created custom text search dictionary following instructions found in
https://github.com/nediam/tsearch-polish/blob/wiki/PolskiSlownikTsearchPostgreSQL.md.
It is in Polish but has two simple steps:
1. Unpack
http://tsearch-polish.googlecode.com/files/tsearch_data_polish_20120730.zip
and copy to share/tsearch_data/ folder
2. Run commands
CREATE TEXT SEARCH CONFIGURATION public.polish ( COPY = pg_catalog.english
);
CREATE TEXT SEARCH DICTIONARY polish_ispell (
TEMPLATE = ispell,
DictFile = polish, -- tsearch_data/polish.dict
AffFile = polish, -- tsearch_data/polish.affix
StopWords = polish -- tsearch_data/polish.stop
);
CREATE TEXT SEARCH DICTIONARY polish_synonym (
TEMPLATE = synonym,
SYNONYMS = polish -- tsearch_data/polish.syn
);
CREATE TEXT SEARCH DICTIONARY polish_thesaurus (
TEMPLATE = thesaurus,
DictFile = polish, -- tsearch_data/polish.ths
Dictionary = polish_ispell
);
ALTER TEXT SEARCH CONFIGURATION polish
ALTER MAPPING FOR asciiword, asciihword, hword_asciipart, word, hword,
hword_part
WITH polish_thesaurus, polish_synonym, polish_ispell, simple;
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' );
dictionary = 'polish_ispell'
instead of
dictionary = 'public.polish_ispell'
psql -f pg_dump_file raises error:
ERROR: text search dictionary "polish_ispell" does not exist
There is of course simple workaround: manually correct file created by
pg_dump.
Adam
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: BUG #15181: pg_dump - missing schema in CREATE TEXT SEARCH DICTIONARY
2018-04-30 15:02 BUG #15181: pg_dump - missing schema in CREATE TEXT SEARCH DICTIONARY PG Bug reporting form <noreply@postgresql.org>
@ 2018-04-30 15:30 ` Tom Lane <tgl@sss.pgh.pa.us>
2018-04-30 15:53 ` Re: BUG #15181: pg_dump - missing schema in CREATE TEXT SEARCH DICTIONARY Adam Bartoszewicz <adam.bartoszewicz@gmail.com>
0 siblings, 1 reply; 3+ messages in thread
From: Tom Lane @ 2018-04-30 15:30 UTC (permalink / raw)
To: adam.bartoszewicz@gmail.com; +Cc: pgsql-bugs@lists.postgresql.org
=?utf-8?q?PG_Bug_reporting_form?= <noreply@postgresql.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
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: BUG #15181: pg_dump - missing schema in CREATE TEXT SEARCH DICTIONARY
2018-04-30 15:02 BUG #15181: pg_dump - missing schema in CREATE TEXT SEARCH DICTIONARY PG Bug reporting form <noreply@postgresql.org>
2018-04-30 15:30 ` Re: BUG #15181: pg_dump - missing schema in CREATE TEXT SEARCH DICTIONARY Tom Lane <tgl@sss.pgh.pa.us>
@ 2018-04-30 15:53 ` Adam Bartoszewicz <adam.bartoszewicz@gmail.com>
0 siblings, 0 replies; 3+ messages in thread
From: Adam Bartoszewicz @ 2018-04-30 15:53 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-bugs@lists.postgresql.org
You are right. "Dictionary = public.polish_ispell" resolves the problem.
Thank you.
Adam Bartoszewicz
W dniu 2018-04-30 o 17:30, Tom Lane pisze:
> =?utf-8?q?PG_Bug_reporting_form?= <noreply@postgresql.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
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2018-04-30 15:53 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-04-30 15:02 BUG #15181: pg_dump - missing schema in CREATE TEXT SEARCH DICTIONARY PG Bug reporting form <noreply@postgresql.org>
2018-04-30 15:30 ` Tom Lane <tgl@sss.pgh.pa.us>
2018-04-30 15:53 ` Adam Bartoszewicz <adam.bartoszewicz@gmail.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox