Thread

  1. help: collation support on Windows

    Peter Eisentraut <peter_e@gmx.net> — 2011-02-25T19:32:32Z

    According to the online documentation, the APIs are there:
    http://msdn.microsoft.com/en-ca/library/a7cwbx4t.aspx
    
    Now we'd need someone brave try to make it work.  The starting point
    would be to define HAVE_LOCALE_T and then make it build.  Microsoft has
    all the relevant functions and types with an underscore in front
    (_strcoll_l, etc.), so some extra #defining will probably be necessary.
    
    Also, initdb will need to be patched to get a list of OS locales to
    populate the pg_collation catalog with.
    
    Finally, a regression test customized for Windows, but I can help with
    that later.
    
    
    
    
  2. Re: help: collation support on Windows

    Andrew Dunstan <andrew@dunslane.net> — 2011-02-25T21:54:59Z

    
    On 02/25/2011 02:32 PM, Peter Eisentraut wrote:
    > According to the online documentation, the APIs are there:
    > http://msdn.microsoft.com/en-ca/library/a7cwbx4t.aspx
    >
    > Now we'd need someone brave try to make it work.  The starting point
    > would be to define HAVE_LOCALE_T and then make it build.  Microsoft has
    > all the relevant functions and types with an underscore in front
    > (_strcoll_l, etc.), so some extra #defining will probably be necessary.
    >
    > Also, initdb will need to be patched to get a list of OS locales to
    > populate the pg_collation catalog with.
    >
    > Finally, a regression test customized for Windows, but I can help with
    > that later.
    >
    >
    >
    
    
    What is the equivalent of "locale -a"?
    
    cheers
    
    andrew
    
    
  3. Re: help: collation support on Windows

    Dave Page <dpage@pgadmin.org> — 2011-02-25T21:58:46Z

    On Fri, Feb 25, 2011 at 9:54 PM, Andrew Dunstan <andrew@dunslane.net> wrote:
    >
    >
    > On 02/25/2011 02:32 PM, Peter Eisentraut wrote:
    >>
    >> According to the online documentation, the APIs are there:
    >> http://msdn.microsoft.com/en-ca/library/a7cwbx4t.aspx
    >>
    >> Now we'd need someone brave try to make it work.  The starting point
    >> would be to define HAVE_LOCALE_T and then make it build.  Microsoft has
    >> all the relevant functions and types with an underscore in front
    >> (_strcoll_l, etc.), so some extra #defining will probably be necessary.
    >>
    >> Also, initdb will need to be patched to get a list of OS locales to
    >> populate the pg_collation catalog with.
    >>
    >> Finally, a regression test customized for Windows, but I can help with
    >> that later.
    >>
    >>
    >>
    >
    >
    > What is the equivalent of "locale -a"?
    
    There isn't a command that I know of, but the API function you
    probably need is EnumSystemLocales.
    
    
    -- 
    Dave Page
    Blog: http://pgsnake.blogspot.com
    Twitter: @pgsnake
    
    EnterpriseDB UK: http://www.enterprisedb.com
    The Enterprise PostgreSQL Company
    
    
  4. Re: help: collation support on Windows

    Magnus Hagander <magnus@hagander.net> — 2011-02-25T22:00:24Z

    On Fri, Feb 25, 2011 at 22:58, Dave Page <dpage@pgadmin.org> wrote:
    > On Fri, Feb 25, 2011 at 9:54 PM, Andrew Dunstan <andrew@dunslane.net> wrote:
    >>
    >>
    >> On 02/25/2011 02:32 PM, Peter Eisentraut wrote:
    >>>
    >>> According to the online documentation, the APIs are there:
    >>> http://msdn.microsoft.com/en-ca/library/a7cwbx4t.aspx
    >>>
    >>> Now we'd need someone brave try to make it work.  The starting point
    >>> would be to define HAVE_LOCALE_T and then make it build.  Microsoft has
    >>> all the relevant functions and types with an underscore in front
    >>> (_strcoll_l, etc.), so some extra #defining will probably be necessary.
    >>>
    >>> Also, initdb will need to be patched to get a list of OS locales to
    >>> populate the pg_collation catalog with.
    >>>
    >>> Finally, a regression test customized for Windows, but I can help with
    >>> that later.
    >>>
    >>>
    >>>
    >>
    >>
    >> What is the equivalent of "locale -a"?
    >
    > There isn't a command that I know of, but the API function you
    > probably need is EnumSystemLocales.
    
    Yeah. If you want example code, you can probably lift something from
    the old pginstaller project on pgfoundry - we use that code to
    populate the dropdown box for initdb there.
    
    -- 
     Magnus Hagander
     Me: http://www.hagander.net/
     Work: http://www.redpill-linpro.com/
    
    
  5. Re: help: collation support on Windows

    Peter Eisentraut <peter_e@gmx.net> — 2011-04-07T21:16:48Z

    On fre, 2011-02-25 at 21:32 +0200, Peter Eisentraut wrote:
    > According to the online documentation, the APIs are there:
    > http://msdn.microsoft.com/en-ca/library/a7cwbx4t.aspx
    > 
    > Now we'd need someone brave try to make it work.  The starting point
    > would be to define HAVE_LOCALE_T and then make it build.  Microsoft has
    > all the relevant functions and types with an underscore in front
    > (_strcoll_l, etc.), so some extra #defining will probably be necessary.
    
    OK, I got that working now.  Patch attached.
    
    > Also, initdb will need to be patched to get a list of OS locales to
    > populate the pg_collation catalog with.
    
    That still needs work, but you can run CREATE COLLATION manually.
    
    > Finally, a regression test customized for Windows, but I can help with
    > that later.
    
    If you doctor the existing linux test to create appropriately named
    collations before running the actual tests, and you hack the
    vcregress.pl driver script to run the tests in UTF8 instead of
    SQL_ASCII, then all the tests except the Turkish case conversion tests
    pass.  So looks pretty good so far.