Re: Encoding names - Mailing list pgsql-hackers

From Thomas Lockhart
Subject Re: Encoding names
Date
Msg-id 3A93C4E5.5A052DEF@alumni.caltech.edu
Whole thread Raw
In response to Re: Encoding names  (Karel Zak <zakkr@zf.jcu.cz>)
Responses Re: Encoding names  (Karel Zak <zakkr@zf.jcu.cz>)
List pgsql-hackers
>  You not must change current names, you can add to pg_conv_tbl[] new lines
> with names synonym for already existing encoding...
>  {LATIN1, "LATIN1",     0, latin12mic, mic2latin1, 0, 0},
>  {LATIN1, "ISO-8859-1", 0, latin12mic, mic2latin1, 0, 0},
>  And if you order this table by alphabet and in pg_char_to_encoding()
> you use Knuth's binary search intead current seq. scannig by for() every
> thing will faster and more nice. It's easy.

As you probably know, there is already a binary search algorithm coded
up for the date/time string lookups in utils/adt/datetime.c. Since that
lookup caches the last value (which could be done here too) most lookups
are immediate.

Are you proposing to make a change Karel, or just encouraging others? :)
                   - Thomas


pgsql-hackers by date:

Previous
From: Robert Schrem
Date:
Subject: Re: Re: floating point representation
Next
From: The Hermit Hacker
Date:
Subject: Re: beta5 ...