Search Postgresql Archives

Re: ERROR: functions in index expression must be marked IMMUTABLE

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 03.03.2017 11:43, Geoff Winkless wrote:
​One alternative would be to make to_date accept all language variants of months simultaneously. A quick search of google suggests that there aren't any overlaps between languages (ie where one language uses "Foo" for March and another uses "Foo" for May), although you would have to​ do some more intense research to be sure. As far as I can see there's no other reason why to_date would need to be marked as stable/volatile, is there?

As a side-note, it seems there are overlapping short months:


Using
this webpage http://web.library.yale.edu/cataloging/months.htm

this JS(Firefox) JSON.stringify([for (x of document.querySelectorAll('table.grid tr td')) x.textContent])
this Python

import pprint
from collections import defaultdict

def chunks(l, n):
    """Yield successive n-sized chunks from l."""
    for i in range(0, len(l), n):
        yield l[i:i + n]

a=<json output from Firefox>
a=list(chunks(a, 13))

dd=defaultdict(list)

for l in a:
     for i, m in enumerate(l):
         if i == 0:
             continue
         dd[m].append((i, l[0]))

pprint.pprint(dict(dd))
{'\nmart\n': [(3, 'Serbian')],
 'Ag.': [(8, 'Indonesian')],
 'Agustos': [(8, 'Turkish')],
 'Apr': [(4, 'Latin')],
 'Apr.': [(4, 'English'),
          (4, 'German'),
          (4, 'Greek, Modern'),
          (4, 'Indonesian'),
          (4, 'Malaysian'),
          (4, 'Romanian')],
 'Aralik': [(12, 'Turkish')],
 'Aug.': [(8, 'English'),
          (8, 'German'),
          (8, 'Greek, Modern'),
          (8, 'Latin'),
          (8, 'Romanian')],
 'Awst': [(8, 'Welsh')],
 'Chwef.': [(2, 'Welsh')],
 'Dec.': [(12, 'English'), (12, 'Latin'), (12, 'Romanian')],
 'Dek.': [(12, 'Greek, Modern')],
 'Des.': [(12, 'Indonesian')],
 'Dez.': [(12, 'German')],
 'Dis.': [(12, 'Malaysian')],
 'Ebr.': [(4, 'Welsh')],
 'Ekim': [(10, 'Turkish')],
 'Eylul': [(9, 'Turkish')],
 'Feb.': [(2, 'English'), (2, 'German'), (2, 'Malaysian'), (2, 'Romanian')],
 'Febr.': [(2, 'Latin')],
 'Gorff.': [(7, 'Welsh')],
 'Haziran': [(6, 'Turkish')],
 'Hyd.': [(10, 'Welsh')],
 'Ian.': [(1, 'Greek, Modern'), (1, 'Latin'), (1, 'Romanian')],
 'Ion.': [(1, 'Welsh')],
 'Ioul.': [(7, 'Greek, Modern')],
 'Ioun.': [(6, 'Greek, Modern')],
 'Iul.': [(7, 'Latin')],
 'Iulie': [(7, 'Romanian')],
 'Iun.': [(6, 'Latin')],
 'Iunie': [(6, 'Romanian')],
 'Jan.': [(1, 'English'), (1, 'Malaysian')],
 'Jan./Djan.\xc2\xa0': [(1, 'Indonesian')],
 'Jan./J\xc3\xa4n.': [(1, 'German')],
 'Julai': [(7, 'Malaysian')],
 'Juli': [(7, 'German')],
 'Juli/Djuli': [(7, 'Indonesian')],
 'July': [(7, 'English')],
 'Jun': [(6, 'Malaysian')],
 'June': [(6, 'English')],
 'Juni': [(6, 'German')],
 'Juni/Djuni': [(6, 'Indonesian')],
 'Kasim': [(11, 'Turkish')],
 'Mac': [(3, 'Malaysian')],
 'Mai': [(5, 'German'), (5, 'Romanian'), (5, 'Welsh')],
 'Mai.': [(5, 'Latin')],
 'Maios': [(5, 'Greek, Modern')],
 'Mar.': [(3, 'English'), (3, 'Romanian')],
 'Mart.': [(3, 'Greek, Modern'), (3, 'Latin')],
 'Maw.': [(3, 'Welsh')],
 'May': [(5, 'English')],
 'Mayis': [(5, 'Turkish')],
 'Medi': [(9, 'Welsh')],
 'Meh.': [(6, 'Welsh')],
 'Mei': [(5, 'Malaysian')],
 'Mei/Mai': [(5, 'Indonesian')],
 'Mrt.': [(3, 'Indonesian')],
 'M\xc3\xa4rz': [(3, 'German')],
 'Nisan': [(4, 'Turkish')],
 'Noem.': [(11, 'Greek, Modern')],
 'Noiem.': [(11, 'Romanian')],
 'Nop.': [(11, 'Indonesian')],
 'Nov.': [(11, 'English'), (11, 'German'), (11, 'Latin'), (11, 'Malaysian')],
 'Ocak': [(1, 'Turkish')],
 'Oct.': [(10, 'English'), (10, 'Latin'), (10, 'Romanian')],
 'Og': [(8, 'Malaysian')],
 'Okt.': [(10, 'German'),
          (10, 'Greek, Modern'),
          (10, 'Indonesian'),
          (10, 'Malaysian')],
 'Peb.': [(2, 'Indonesian')],
 'Phevr.': [(2, 'Greek, Modern')],
 'Rhag.': [(12, 'Welsh')],
 'Saus.': [(1, 'Lithuanian')],
 'Sept.': [(9, 'English'),
           (9, 'German'),
           (9, 'Greek, Modern'),
           (9, 'Indonesian'),
           (9, 'Latin'),
           (9, 'Malaysian'),
           (9, 'Romanian')],
 'Subat': [(2, 'Turkish')],
 'Tach.': [(11, 'Welsh')],
 'Temmuz': [(7, 'Turkish')],
 'abr.': [(4, 'Spanish')],
 'abril': [(4, 'Portuguese')],
 'ag.': [(8, 'Italian')],
 'agosto': [(8, 'Portuguese'), (8, 'Spanish')],
 'ao\xc3\xbbt': [(8, 'French')],
 'apr.': [(4, 'Dutch'),
          (4, 'Estonian'),
          (4, 'Italian'),
          (4, 'Latvian'),
          (4, 'Russian')],
 'apr./mali traven': [(4, 'Slovenian')],
 'april': [(4, 'Bosnian'),
           (4, 'Bulgarian'),
           (4, 'Danish'),
           (4, 'Norwegian'),
           (4, 'Serbian'),
           (4, 'Swedish')],
 'aug.': [(8, 'Bosnian'),
          (8, 'Danish'),
          (8, 'Dutch'),
          (8, 'Estonian'),
          (8, 'Hungarian'),
          (8, 'Latvian'),
          (8, 'Norwegian'),
          (8, 'Swedish')],
 'avg.': [(8, 'Bulgarian'), (8, 'Russian'), (8, 'Serbian')],
 'avg./veliki\xc2\xa0srpan': [(8, 'Slovenian')],
 'avril': [(4, 'French')],
 'bal.': [(4, 'Lithuanian')],
 'ber.': [(3, 'Ukranian')],
 'birz': [(6, 'Lithuanian')],
 'brez.': [(3, 'Czech')],
 'brez./mar.': [(3, 'Slovak')],
 'cerv.': [(6, 'Czech')],
 'cerv./j\xc3\xban': [(6, 'Slovak')],
 'cerven.': [(7, 'Czech')],
 'cerven./j\xc3\xbal': [(7, 'Slovak')],
 'cher.': [(6, 'Ukranian')],
 'cherv.': [(6, 'Belorusian')],
 'czerw.': [(6, 'Polish')],
 'dec.': [(12, 'Danish'),
          (12, 'Dutch'),
          (12, 'Hungarian'),
          (12, 'Latvian'),
          (12, 'Serbian'),
          (12, 'Swedish')],
 'dec./gr.': [(12, 'Slovenian')],
 'dec.\xc2\xa0': [(12, 'Bosnian')],
 'dek.': [(12, 'Bulgarian'), (12, 'Russian')],
 'des.': [(12, 'Norwegian')],
 'dets.': [(12, 'Estonian')],
 'dez.': [(12, 'Portuguese')],
 'dic.': [(12, 'Italian'), (12, 'Spanish')],
 'dub.': [(4, 'Czech')],
 'dub./apr.': [(4, 'Slovak')],
 'd\xc3\xa9c.': [(12, 'French')],
 'enero': [(1, 'Spanish')],
 'feb.': [(2, 'Bosnian'),
          (2, 'Dutch'),
          (2, 'Hungarian'),
          (2, 'Latvian'),
          (2, 'Spanish')],
 'feb./svec.': [(2, 'Slovenian')],
 'febbr.': [(2, 'Italian')],
 'febr.': [(2, 'Danish'), (2, 'Norwegian'), (2, 'Serbian'), (2, 'Swedish')],
 'fev.': [(2, 'Portuguese')],
 'fevr.': [(2, 'Bulgarian'), (2, 'Russian')],
 'f\xc3\xa9vr.': [(2, 'French')],
 'geg.': [(5, 'Lithuanian')],
 'genn.': [(1, 'Italian')],
 'giugno': [(6, 'Italian')],
 'gr.': [(12, 'Lithuanian')],
 'grudz.': [(12, 'Polish')],
 'hrud.': [(12, 'Ukranian')],
 'ian.': [(1, 'Bulgarian')],
 'ianv.': [(1, 'Russian')],
 "iiul'": [(7, 'Russian')],
 "iiun'": [(6, 'Russian')],
 'iuli': [(7, 'Bulgarian')],
 'iuni': [(6, 'Bulgarian')],
 'jaan.': [(1, 'Estonian')],
 'jan.': [(1, 'Bosnian'),
          (1, 'Danish'),
          (1, 'Dutch'),
          (1, 'Hungarian'),
          (1, 'Latvian'),
          (1, 'Norwegian'),
          (1, 'Portuguese'),
          (1, 'Serbian'),
          (1, 'Swedish')],
 'jan./pros.': [(1, 'Slovenian')],
 'janv.': [(1, 'French')],
 'juil.': [(7, 'French')],
 'juin': [(6, 'French')],
 'jul.': [(7, 'Hungarian'), (7, 'Spanish')],
 'jul./mali srpan': [(7, 'Slovenian')],
 'julho': [(7, 'Portuguese')],
 'juli': [(7, 'Bosnian'),
          (7, 'Danish'),
          (7, 'Dutch'),
          (7, 'Norwegian'),
          (7, 'Serbian'),
          (7, 'Swedish')],
 'julijs': [(7, 'Latvian')],
 'jun.': [(6, 'Hungarian'), (6, 'Spanish')],
 'jun./roz.': [(6, 'Slovenian')],
 'junho': [(6, 'Portuguese')],
 'juni': [(6, 'Bosnian'),
          (6, 'Danish'),
          (6, 'Dutch'),
          (6, 'Norwegian'),
          (6, 'Serbian'),
          (6, 'Swedish')],
 'junijs': [(6, 'Latvian')],
 'juuli': [(7, 'Estonian')],
 'juuni': [(6, 'Estonian')],
 'kastr.': [(10, 'Belorusian')],
 'kol.': [(8, 'Croatian')],
 'kovas': [(3, 'Lithuanian')],
 'kras.': [(4, 'Belorusian')],
 'kvet.': [(5, 'Czech')],
 'kvet/m\xc3\xa1j': [(5, 'Slovak')],
 'kvit.': [(4, 'Ukranian')],
 'kwiec.': [(4, 'Polish')],
 "l'ad./jan.": [(1, 'Slovak')],
 'lapkr.': [(11, 'Lithuanian')],
 'led.': [(1, 'Czech')],
 'liepa': [(7, 'Lithuanian')],
 'lip.': [(7, 'Belorusian'), (6, 'Croatian'), (7, 'Polish')],
 'list.': [(11, 'Belorusian'), (10, 'Croatian'), (11, 'Czech')],
 'list./nov.': [(11, 'Slovak')],
 'listop.': [(11, 'Polish')],
 'liut.': [(2, 'Belorusian'), (2, 'Ukranian')],
 'luglio': [(7, 'Italian')],
 'luty': [(2, 'Polish')],
 'lyp.': [(7, 'Ukranian')],
 'lyst.': [(11, 'Ukranian')],
 'maart': [(3, 'Dutch')],
 'magg.': [(5, 'Italian')],
 'mai': [(5, 'Bulgarian'),
         (5, 'Estonian'),
         (5, 'French'),
         (5, 'Norwegian'),
         (5, 'Russian')],
 'maijs': [(5, 'Latvian')],
 'maio': [(5, 'Portuguese')],
 'maj': [(5, 'Bosnian'),
         (5, 'Danish'),
         (5, 'Polish'),
         (5, 'Serbian'),
         (5, 'Swedish')],
 'maj./veliki traven': [(5, 'Slovenian')],
 'mar.': [(3, 'Italian'), (3, 'Polish')],
 'mar./sus.': [(3, 'Slovenian')],
 'mars': [(3, 'French'), (3, 'Norwegian'), (3, 'Swedish')],
 'mart': [(3, 'Bosnian'), (3, 'Bulgarian'), (3, 'Russian'), (3, 'Turkish')],
 'marts': [(3, 'Danish'), (3, 'Latvian')],
 'marzo': [(3, 'Spanish')],
 'mar\xc3\xa7o': [(3, 'Portuguese')],
 'mayo': [(5, 'Spanish')],
 'mei': [(5, 'Dutch')],
 'm\xc3\xa1j.': [(5, 'Hungarian')],
 'm\xc3\xa1rc.': [(3, 'Hungarian')],
 'm\xc3\xa4rts': [(3, 'Estonian')],
 'noem.': [(11, 'Bulgarian')],
 "noiabr'": [(11, 'Russian')],
 'nov.': [(11, 'Bosnian'),
          (11, 'Danish'),
          (11, 'Dutch'),
          (11, 'Estonian'),
          (11, 'French'),
          (11, 'Hungarian'),
          (11, 'Italian'),
          (11, 'Latvian'),
          (11, 'Norwegian'),
          (11, 'Portuguese'),
          (11, 'Serbian'),
          (11, 'Spanish'),
          (11, 'Swedish')],
 'nov./list.': [(11, 'Slovenian')],
 'oct.': [(10, 'French'), (10, 'Spanish')],
 'oct./okt.': [(10, 'Dutch')],
 'okt.': [(10, 'Bosnian'),
          (10, 'Bulgarian'),
          (10, 'Danish'),
          (10, 'Estonian'),
          (10, 'Hungarian'),
          (10, 'Latvian'),
          (10, 'Norwegian'),
          (10, 'Russian'),
          (10, 'Serbian'),
          (10, 'Swedish')],
 'okt./vino.': [(10, 'Slovenian')],
 'ott.': [(10, 'Italian')],
 'out.': [(10, 'Portuguese')],
 'ozuj.': [(3, 'Croatian')],
 'pazdz.': [(10, 'Polish')],
 'pros.': [(12, 'Croatian'), (12, 'Czech')],
 'pros./dec.': [(12, 'Slovak')],
 'rugp.': [(8, 'Lithuanian')],
 'rugs.': [(9, 'Lithuanian')],
 'ruj.': [(9, 'Croatian')],
 'ruj./okt.': [(10, 'Slovak')],
 'r\xc3\xadj.': [(10, 'Czech')],
 'sak./mar.': [(3, 'Belorusian')],
 'sent.': [(9, 'Russian')],
 'sept.': [(9, 'Bosnian'),
           (9, 'Bulgarian'),
           (9, 'Danish'),
           (9, 'Dutch'),
           (9, 'Estonian'),
           (9, 'French'),
           (9, 'Latvian'),
           (9, 'Norwegian'),
           (9, 'Serbian'),
           (9, 'Swedish')],
 'sept./kim.': [(9, 'Slovenian')],
 'sept./set.': [(9, 'Spanish')],
 'serp.': [(8, 'Ukranian')],
 'set.': [(9, 'Portuguese')],
 'sett.': [(9, 'Italian')],
 'sich.': [(1, 'Ukranian')],
 'sierp.': [(8, 'Polish')],
 'sijec.': [(1, 'Croatian')],
 'snezh.': [(12, 'Belorusian')],
 'spalis': [(10, 'Lithuanian')],
 'srp.': [(7, 'Croatian'), (8, 'Czech')],
 'srp./aug.': [(8, 'Slovak')],
 'stud.': [(11, 'Croatian')],
 'studz.': [(1, 'Belorusian')],
 'stycz.': [(1, 'Polish')],
 'svib.': [(5, 'Croatian')],
 'szept.': [(9, 'Hungarian')],
 'trav.': [(5, 'Belorusian'), (4, 'Croatian'), (5, 'Ukranian')],
 'vas.': [(2, 'Lithuanian')],
 'veebr.': [(2, 'Estonian')],
 'velj.': [(2, 'Croatian')],
 'ver.': [(9, 'Ukranian')],
 'veras.': [(9, 'Belorusian')],
 'wrzes.': [(9, 'Polish')],
 "zhniven'": [(8, 'Belorusian')],
 'zhovt.': [(10, 'Ukranian')],
 'z\xc3\xa1r.': [(9, 'Czech')],
 'z\xc3\xa1ri./sept.': [(9, 'Slovak')],
 '\xc3\xa1pr.': [(4, 'Hungarian')],
 '\xc3\xban.': [(2, 'Czech')],
 '\xc3\xban./feb.': [(2, 'Slovak')]}


Sven

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux