summaryrefslogtreecommitdiffstats
path: root/src/test/regress/expected/tsdicts.out
blob: 4eff85da7936e80d4568ebaaafc1d9b93836629c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
--Test text search dictionaries and configurations
-- Test ISpell dictionary with ispell affix file
CREATE TEXT SEARCH DICTIONARY ispell (
                        Template=ispell,
                        DictFile=ispell_sample,
                        AffFile=ispell_sample
);
SELECT ts_lexize('ispell', 'skies');
 ts_lexize 
-----------
 {sky}
(1 row)

SELECT ts_lexize('ispell', 'bookings');
   ts_lexize    
----------------
 {booking,book}
(1 row)

SELECT ts_lexize('ispell', 'booking');
   ts_lexize    
----------------
 {booking,book}
(1 row)

SELECT ts_lexize('ispell', 'foot');
 ts_lexize 
-----------
 {foot}
(1 row)

SELECT ts_lexize('ispell', 'foots');
 ts_lexize 
-----------
 {foot}
(1 row)

SELECT ts_lexize('ispell', 'rebookings');
   ts_lexize    
----------------
 {booking,book}
(1 row)

SELECT ts_lexize('ispell', 'rebooking');
   ts_lexize    
----------------
 {booking,book}
(1 row)

SELECT ts_lexize('ispell', 'rebook');
 ts_lexize 
-----------
 
(1 row)

SELECT ts_lexize('ispell', 'unbookings');
 ts_lexize 
-----------
 {book}
(1 row)

SELECT ts_lexize('ispell', 'unbooking');
 ts_lexize 
-----------
 {book}
(1 row)

SELECT ts_lexize('ispell', 'unbook');
 ts_lexize 
-----------
 {book}
(1 row)

SELECT ts_lexize('ispell', 'footklubber');
   ts_lexize    
----------------
 {foot,klubber}
(1 row)

SELECT ts_lexize('ispell', 'footballklubber');
                      ts_lexize                       
------------------------------------------------------
 {footballklubber,foot,ball,klubber,football,klubber}
(1 row)

SELECT ts_lexize('ispell', 'ballyklubber');
   ts_lexize    
----------------
 {ball,klubber}
(1 row)

SELECT ts_lexize('ispell', 'footballyklubber');
      ts_lexize      
---------------------
 {foot,ball,klubber}
(1 row)

-- Test ISpell dictionary with hunspell affix file
CREATE TEXT SEARCH DICTIONARY hunspell (
                        Template=ispell,
                        DictFile=ispell_sample,
                        AffFile=hunspell_sample
);
SELECT ts_lexize('hunspell', 'skies');
 ts_lexize 
-----------
 {sky}
(1 row)

SELECT ts_lexize('hunspell', 'bookings');
   ts_lexize    
----------------
 {booking,book}
(1 row)

SELECT ts_lexize('hunspell', 'booking');
   ts_lexize    
----------------
 {booking,book}
(1 row)

SELECT ts_lexize('hunspell', 'foot');
 ts_lexize 
-----------
 {foot}
(1 row)

SELECT ts_lexize('hunspell', 'foots');
 ts_lexize 
-----------
 {foot}
(1 row)

SELECT ts_lexize('hunspell', 'rebookings');
   ts_lexize    
----------------
 {booking,book}
(1 row)

SELECT ts_lexize('hunspell', 'rebooking');
   ts_lexize    
----------------
 {booking,book}
(1 row)

SELECT ts_lexize('hunspell', 'rebook');
 ts_lexize 
-----------
 
(1 row)

SELECT ts_lexize('hunspell', 'unbookings');
 ts_lexize 
-----------
 {book}
(1 row)

SELECT ts_lexize('hunspell', 'unbooking');
 ts_lexize 
-----------
 {book}
(1 row)

SELECT ts_lexize('hunspell', 'unbook');
 ts_lexize 
-----------
 {book}
(1 row)

SELECT ts_lexize('hunspell', 'footklubber');
   ts_lexize    
----------------
 {foot,klubber}
(1 row)

SELECT ts_lexize('hunspell', 'footballklubber');
                      ts_lexize                       
------------------------------------------------------
 {footballklubber,foot,ball,klubber,football,klubber}
(1 row)

SELECT ts_lexize('hunspell', 'ballyklubber');
   ts_lexize    
----------------
 {ball,klubber}
(1 row)

SELECT ts_lexize('hunspell', 'footballyklubber');
      ts_lexize      
---------------------
 {foot,ball,klubber}
(1 row)

-- Test ISpell dictionary with hunspell affix file with FLAG long parameter
CREATE TEXT SEARCH DICTIONARY hunspell_long (
                        Template=ispell,
                        DictFile=hunspell_sample_long,
                        AffFile=hunspell_sample_long
);
SELECT ts_lexize('hunspell_long', 'skies');
 ts_lexize 
-----------
 {sky}
(1 row)

SELECT ts_lexize('hunspell_long', 'bookings');
   ts_lexize    
----------------
 {booking,book}
(1 row)

SELECT ts_lexize('hunspell_long', 'booking');
   ts_lexize    
----------------
 {booking,book}
(1 row)

SELECT ts_lexize('hunspell_long', 'foot');
 ts_lexize 
-----------
 {foot}
(1 row)

SELECT ts_lexize('hunspell_long', 'foots');
 ts_lexize 
-----------
 {foot}
(1 row)

SELECT ts_lexize('hunspell_long', 'rebookings');
   ts_lexize    
----------------
 {booking,book}
(1 row)

SELECT ts_lexize('hunspell_long', 'rebooking');
   ts_lexize    
----------------
 {booking,book}
(1 row)

SELECT ts_lexize('hunspell_long', 'rebook');
 ts_lexize 
-----------
 
(1 row)

SELECT ts_lexize('hunspell_long', 'unbookings');
 ts_lexize 
-----------
 {book}
(1 row)

SELECT ts_lexize('hunspell_long', 'unbooking');
 ts_lexize 
-----------
 {book}
(1 row)

SELECT ts_lexize('hunspell_long', 'unbook');
 ts_lexize 
-----------
 {book}
(1 row)

SELECT ts_lexize('hunspell_long', 'booked');
 ts_lexize 
-----------
 {book}
(1 row)

SELECT ts_lexize('hunspell_long', 'footklubber');
   ts_lexize    
----------------
 {foot,klubber}
(1 row)

SELECT ts_lexize('hunspell_long', 'footballklubber');
                      ts_lexize                       
------------------------------------------------------
 {footballklubber,foot,ball,klubber,football,klubber}
(1 row)

SELECT ts_lexize('hunspell_long', 'ballyklubber');
   ts_lexize    
----------------
 {ball,klubber}
(1 row)

SELECT ts_lexize('hunspell_long', 'ballsklubber');
   ts_lexize    
----------------
 {ball,klubber}
(1 row)

SELECT ts_lexize('hunspell_long', 'footballyklubber');
      ts_lexize      
---------------------
 {foot,ball,klubber}
(1 row)

SELECT ts_lexize('hunspell_long', 'ex-machina');
   ts_lexize   
---------------
 {ex-,machina}
(1 row)

-- Test ISpell dictionary with hunspell affix file with FLAG num parameter
CREATE TEXT SEARCH DICTIONARY hunspell_num (
                        Template=ispell,
                        DictFile=hunspell_sample_num,
                        AffFile=hunspell_sample_num
);
SELECT ts_lexize('hunspell_num', 'skies');
 ts_lexize 
-----------
 {sky}
(1 row)

SELECT ts_lexize('hunspell_num', 'sk');
 ts_lexize 
-----------
 {sky}
(1 row)

SELECT ts_lexize('hunspell_num', 'bookings');
   ts_lexize    
----------------
 {booking,book}
(1 row)

SELECT ts_lexize('hunspell_num', 'booking');
   ts_lexize    
----------------
 {booking,book}
(1 row)

SELECT ts_lexize('hunspell_num', 'foot');
 ts_lexize 
-----------
 {foot}
(1 row)

SELECT ts_lexize('hunspell_num', 'foots');
 ts_lexize 
-----------
 {foot}
(1 row)

SELECT ts_lexize('hunspell_num', 'rebookings');
   ts_lexize    
----------------
 {booking,book}
(1 row)

SELECT ts_lexize('hunspell_num', 'rebooking');
   ts_lexize    
----------------
 {booking,book}
(1 row)

SELECT ts_lexize('hunspell_num', 'rebook');
 ts_lexize 
-----------
 
(1 row)

SELECT ts_lexize('hunspell_num', 'unbookings');
 ts_lexize 
-----------
 {book}
(1 row)

SELECT ts_lexize('hunspell_num', 'unbooking');
 ts_lexize 
-----------
 {book}
(1 row)

SELECT ts_lexize('hunspell_num', 'unbook');
 ts_lexize 
-----------
 {book}
(1 row)

SELECT ts_lexize('hunspell_num', 'booked');
 ts_lexize 
-----------
 {book}
(1 row)

SELECT ts_lexize('hunspell_num', 'footklubber');
   ts_lexize    
----------------
 {foot,klubber}
(1 row)

SELECT ts_lexize('hunspell_num', 'footballklubber');
                      ts_lexize                       
------------------------------------------------------
 {footballklubber,foot,ball,klubber,football,klubber}
(1 row)

SELECT ts_lexize('hunspell_num', 'ballyklubber');
   ts_lexize    
----------------
 {ball,klubber}
(1 row)

SELECT ts_lexize('hunspell_num', 'footballyklubber');
      ts_lexize      
---------------------
 {foot,ball,klubber}
(1 row)

-- Test suitability of affix and dict files
CREATE TEXT SEARCH DICTIONARY hunspell_err (
						Template=ispell,
						DictFile=ispell_sample,
						AffFile=hunspell_sample_long
);
ERROR:  invalid affix alias "GJUS"
CREATE TEXT SEARCH DICTIONARY hunspell_err (
						Template=ispell,
						DictFile=ispell_sample,
						AffFile=hunspell_sample_num
);
ERROR:  invalid affix flag "SZ\"
CREATE TEXT SEARCH DICTIONARY hunspell_invalid_1 (
						Template=ispell,
						DictFile=hunspell_sample_long,
						AffFile=ispell_sample
);
CREATE TEXT SEARCH DICTIONARY hunspell_invalid_2 (
						Template=ispell,
						DictFile=hunspell_sample_long,
						AffFile=hunspell_sample_num
);
CREATE TEXT SEARCH DICTIONARY hunspell_invalid_3 (
						Template=ispell,
						DictFile=hunspell_sample_num,
						AffFile=ispell_sample
);
CREATE TEXT SEARCH DICTIONARY hunspell_err (
						Template=ispell,
						DictFile=hunspell_sample_num,
						AffFile=hunspell_sample_long
);
ERROR:  invalid affix alias "302,301,202,303"
-- Synonym dictionary
CREATE TEXT SEARCH DICTIONARY synonym (
						Template=synonym,
						Synonyms=synonym_sample
);
SELECT ts_lexize('synonym', 'PoStGrEs');
 ts_lexize 
-----------
 {pgsql}
(1 row)

SELECT ts_lexize('synonym', 'Gogle');
 ts_lexize 
-----------
 {googl}
(1 row)

SELECT ts_lexize('synonym', 'indices');
 ts_lexize 
-----------
 {index}
(1 row)

-- test altering boolean parameters
SELECT dictinitoption FROM pg_ts_dict WHERE dictname = 'synonym';
       dictinitoption        
-----------------------------
 synonyms = 'synonym_sample'
(1 row)

ALTER TEXT SEARCH DICTIONARY synonym (CaseSensitive = 1);
SELECT ts_lexize('synonym', 'PoStGrEs');
 ts_lexize 
-----------
 
(1 row)

SELECT dictinitoption FROM pg_ts_dict WHERE dictname = 'synonym';
                 dictinitoption                 
------------------------------------------------
 synonyms = 'synonym_sample', casesensitive = 1
(1 row)

ALTER TEXT SEARCH DICTIONARY synonym (CaseSensitive = 2);  -- fail
ERROR:  casesensitive requires a Boolean value
ALTER TEXT SEARCH DICTIONARY synonym (CaseSensitive = off);
SELECT ts_lexize('synonym', 'PoStGrEs');
 ts_lexize 
-----------
 {pgsql}
(1 row)

SELECT dictinitoption FROM pg_ts_dict WHERE dictname = 'synonym';
                   dictinitoption                   
----------------------------------------------------
 synonyms = 'synonym_sample', casesensitive = 'off'
(1 row)

-- Create and simple test thesaurus dictionary
-- More tests in configuration checks because ts_lexize()
-- cannot pass more than one word to thesaurus.
CREATE TEXT SEARCH DICTIONARY thesaurus (
                        Template=thesaurus,
						DictFile=thesaurus_sample,
						Dictionary=english_stem
);
SELECT ts_lexize('thesaurus', 'one');
 ts_lexize 
-----------
 {1}
(1 row)

-- Test ispell dictionary in configuration
CREATE TEXT SEARCH CONFIGURATION ispell_tst (
						COPY=english
);
ALTER TEXT SEARCH CONFIGURATION ispell_tst ALTER MAPPING FOR
	word, numword, asciiword, hword, numhword, asciihword, hword_part, hword_numpart, hword_asciipart
	WITH ispell, english_stem;
SELECT to_tsvector('ispell_tst', 'Booking the skies after rebookings for footballklubber from a foot');
                                            to_tsvector                                             
----------------------------------------------------------------------------------------------------
 'ball':7 'book':1,5 'booking':1,5 'foot':7,10 'football':7 'footballklubber':7 'klubber':7 'sky':3
(1 row)

SELECT to_tsquery('ispell_tst', 'footballklubber');
                                to_tsquery                                
--------------------------------------------------------------------------
 'footballklubber' | 'foot' & 'ball' & 'klubber' | 'football' & 'klubber'
(1 row)

SELECT to_tsquery('ispell_tst', 'footballyklubber:b & rebookings:A & sky');
                               to_tsquery                               
------------------------------------------------------------------------
 'foot':B & 'ball':B & 'klubber':B & ( 'booking':A | 'book':A ) & 'sky'
(1 row)

-- Test ispell dictionary with hunspell affix in configuration
CREATE TEXT SEARCH CONFIGURATION hunspell_tst (
						COPY=ispell_tst
);
ALTER TEXT SEARCH CONFIGURATION hunspell_tst ALTER MAPPING
	REPLACE ispell WITH hunspell;
SELECT to_tsvector('hunspell_tst', 'Booking the skies after rebookings for footballklubber from a foot');
                                            to_tsvector                                             
----------------------------------------------------------------------------------------------------
 'ball':7 'book':1,5 'booking':1,5 'foot':7,10 'football':7 'footballklubber':7 'klubber':7 'sky':3
(1 row)

SELECT to_tsquery('hunspell_tst', 'footballklubber');
                                to_tsquery                                
--------------------------------------------------------------------------
 'footballklubber' | 'foot' & 'ball' & 'klubber' | 'football' & 'klubber'
(1 row)

SELECT to_tsquery('hunspell_tst', 'footballyklubber:b & rebookings:A & sky');
                               to_tsquery                               
------------------------------------------------------------------------
 'foot':B & 'ball':B & 'klubber':B & ( 'booking':A | 'book':A ) & 'sky'
(1 row)

SELECT to_tsquery('hunspell_tst', 'footballyklubber:b <-> sky');
                   to_tsquery                    
-------------------------------------------------
 ( 'foot':B & 'ball':B & 'klubber':B ) <-> 'sky'
(1 row)

SELECT phraseto_tsquery('hunspell_tst', 'footballyklubber sky');
             phraseto_tsquery              
-------------------------------------------
 ( 'foot' & 'ball' & 'klubber' ) <-> 'sky'
(1 row)

-- Test ispell dictionary with hunspell affix with FLAG long in configuration
ALTER TEXT SEARCH CONFIGURATION hunspell_tst ALTER MAPPING
	REPLACE hunspell WITH hunspell_long;
SELECT to_tsvector('hunspell_tst', 'Booking the skies after rebookings for footballklubber from a foot');
                                            to_tsvector                                             
----------------------------------------------------------------------------------------------------
 'ball':7 'book':1,5 'booking':1,5 'foot':7,10 'football':7 'footballklubber':7 'klubber':7 'sky':3
(1 row)

SELECT to_tsquery('hunspell_tst', 'footballklubber');
                                to_tsquery                                
--------------------------------------------------------------------------
 'footballklubber' | 'foot' & 'ball' & 'klubber' | 'football' & 'klubber'
(1 row)

SELECT to_tsquery('hunspell_tst', 'footballyklubber:b & rebookings:A & sky');
                               to_tsquery                               
------------------------------------------------------------------------
 'foot':B & 'ball':B & 'klubber':B & ( 'booking':A | 'book':A ) & 'sky'
(1 row)

-- Test ispell dictionary with hunspell affix with FLAG num in configuration
ALTER TEXT SEARCH CONFIGURATION hunspell_tst ALTER MAPPING
	REPLACE hunspell_long WITH hunspell_num;
SELECT to_tsvector('hunspell_tst', 'Booking the skies after rebookings for footballklubber from a foot');
                                            to_tsvector                                             
----------------------------------------------------------------------------------------------------
 'ball':7 'book':1,5 'booking':1,5 'foot':7,10 'football':7 'footballklubber':7 'klubber':7 'sky':3
(1 row)

SELECT to_tsquery('hunspell_tst', 'footballklubber');
                                to_tsquery                                
--------------------------------------------------------------------------
 'footballklubber' | 'foot' & 'ball' & 'klubber' | 'football' & 'klubber'
(1 row)

SELECT to_tsquery('hunspell_tst', 'footballyklubber:b & rebookings:A & sky');
                               to_tsquery                               
------------------------------------------------------------------------
 'foot':B & 'ball':B & 'klubber':B & ( 'booking':A | 'book':A ) & 'sky'
(1 row)

-- Test synonym dictionary in configuration
CREATE TEXT SEARCH CONFIGURATION synonym_tst (
						COPY=english
);
ALTER TEXT SEARCH CONFIGURATION synonym_tst ALTER MAPPING FOR
	asciiword, hword_asciipart, asciihword
	WITH synonym, english_stem;
SELECT to_tsvector('synonym_tst', 'Postgresql is often called as postgres or pgsql and pronounced as postgre');
                    to_tsvector                    
---------------------------------------------------
 'call':4 'often':3 'pgsql':1,6,8,12 'pronounc':10
(1 row)

SELECT to_tsvector('synonym_tst', 'Most common mistake is to write Gogle instead of Google');
                       to_tsvector                        
----------------------------------------------------------
 'common':2 'googl':7,10 'instead':8 'mistak':3 'write':6
(1 row)

SELECT to_tsvector('synonym_tst', 'Indexes or indices - Which is right plural form of index?');
                 to_tsvector                  
----------------------------------------------
 'form':8 'index':1,3,10 'plural':7 'right':6
(1 row)

SELECT to_tsquery('synonym_tst', 'Index & indices');
     to_tsquery      
---------------------
 'index' & 'index':*
(1 row)

-- test thesaurus in configuration
-- see thesaurus_sample.ths to understand 'odd' resulting tsvector
CREATE TEXT SEARCH CONFIGURATION thesaurus_tst (
						COPY=synonym_tst
);
ALTER TEXT SEARCH CONFIGURATION thesaurus_tst ALTER MAPPING FOR
	asciiword, hword_asciipart, asciihword
	WITH synonym, thesaurus, english_stem;
SELECT to_tsvector('thesaurus_tst', 'one postgres one two one two three one');
           to_tsvector            
----------------------------------
 '1':1,5 '12':3 '123':4 'pgsql':2
(1 row)

SELECT to_tsvector('thesaurus_tst', 'Supernovae star is very new star and usually called supernovae (abbreviation SN)');
                         to_tsvector                          
--------------------------------------------------------------
 'abbrevi':10 'call':8 'new':4 'sn':1,9,11 'star':5 'usual':7
(1 row)

SELECT to_tsvector('thesaurus_tst', 'Booking tickets is looking like a booking a tickets');
                      to_tsvector                      
-------------------------------------------------------
 'card':3,10 'invit':2,9 'like':6 'look':5 'order':1,8
(1 row)

-- invalid: non-lowercase quoted identifiers
CREATE TEXT SEARCH DICTIONARY tsdict_case
(
	Template = ispell,
	"DictFile" = ispell_sample,
	"AffFile" = ispell_sample
);
ERROR:  unrecognized Ispell parameter: "DictFile"
-- Test grammar for configurations
CREATE TEXT SEARCH CONFIGURATION dummy_tst (COPY=english);
-- Overriden mapping change with duplicated tokens.
ALTER TEXT SEARCH CONFIGURATION dummy_tst
  ALTER MAPPING FOR word, word WITH ispell;
-- Not a token supported by the configuration's parser, fails.
ALTER TEXT SEARCH CONFIGURATION dummy_tst
  DROP MAPPING FOR not_a_token, not_a_token;
ERROR:  token type "not_a_token" does not exist
-- Not a token supported by the configuration's parser, fails even
-- with IF EXISTS.
ALTER TEXT SEARCH CONFIGURATION dummy_tst
  DROP MAPPING IF EXISTS FOR not_a_token, not_a_token;
ERROR:  token type "not_a_token" does not exist
-- Token supported by the configuration's parser, succeeds.
ALTER TEXT SEARCH CONFIGURATION dummy_tst
  DROP MAPPING FOR word, word;
-- No mapping for token supported by the configuration's parser, fails.
ALTER TEXT SEARCH CONFIGURATION dummy_tst
  DROP MAPPING FOR word;
ERROR:  mapping for token type "word" does not exist
-- Token supported by the configuration's parser, cannot be found,
-- succeeds with IF EXISTS.
ALTER TEXT SEARCH CONFIGURATION dummy_tst
  DROP MAPPING IF EXISTS FOR word, word;
NOTICE:  mapping for token type "word" does not exist, skipping
-- Re-add mapping, with duplicated tokens supported by the parser.
ALTER TEXT SEARCH CONFIGURATION dummy_tst
  ADD MAPPING FOR word, word WITH ispell;
-- Not a token supported by the configuration's parser, fails.
ALTER TEXT SEARCH CONFIGURATION dummy_tst
  ADD MAPPING FOR not_a_token WITH ispell;
ERROR:  token type "not_a_token" does not exist
DROP TEXT SEARCH CONFIGURATION dummy_tst;