Re: [sqlite] Suggestion about hard-coded time string format YYYY-MM-DD

2012-04-23 Thread Igor Tandetnik
On 4/23/2012 2:34 PM, Pete wrote: Folks, I'm a bit late to this discussion but what are the new PRAGMAs referred to here? They were discussed hypothetically. As in, wouldn't it be nice if there were pragmas to control date and time formats. -- Igor Tandetnik _

[sqlite] Suggestion about hard-coded time string format YYYY-MM-DD

2012-04-23 Thread Pete
2 20:38:37 +0400 > From: Alexey Pechnikov > To: sqlite-users@sqlite.org > Subject: [sqlite] Suggestion about hard-coded time string format >-MM-DD > Message-ID: > > > Content-Type: text/plain; charset=ISO-8859-1 > > Why we can't control this? As

Re: [sqlite] Suggestion about hard-coded time string format YYYY-MM-DD

2012-04-20 Thread Yves Goergen
On 02.04.2012 18:38 CE(S)T, Alexey Pechnikov wrote: > Why we can't control this? As example, in Russia the date format is > DD.MM. and is needed the patch > http://sqlite.mobigroup.ru/fdiff?v1=288ad2e1e017565c&v2=720cb1015e95af7a > > I think the new pragmas DATEFORMAT and TIMEFORMAT will be he

Re: [sqlite] Suggestion about hard-coded time string format YYYY-MM-DD

2012-04-12 Thread Alexey Pechnikov
2012/4/2 Jay A. Kreibich > It would make more sense to just implement a strptime() SQL function > to compliment the existing strftime() function. That would allow > SQLite to understand and convert any incoming date-time format > without depending on specific build parameters. > > But may st

Re: [sqlite] Suggestion about hard-coded time string format YYYY-MM-DD

2012-04-02 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 02/04/12 14:34, Simon Slavin wrote: > I wonder whether it respects languages. A German user living in France has some Swedish names in their list to be sorted. Do you use Swedish sort order, German sort order, German name order or French order? T

Re: [sqlite] Suggestion about hard-coded time string format YYYY-MM-DD

2012-04-02 Thread Nico Williams
On Mon, Apr 2, 2012 at 5:46 PM, Simon Slavin wrote: > Replace part of that routine with something which specifies the locale rather > than fetching it from OS settings.  And store the locale used with the index, > as a COLLATE setting.  Thus leaving it up to whoever writes the CREATE > command

Re: [sqlite] Suggestion about hard-coded time string format YYYY-MM-DD

2012-04-02 Thread Simon Slavin
On 2 Apr 2012, at 10:44pm, Igor Tandetnik wrote: > On 4/2/2012 5:34 PM, Simon Slavin wrote: >> Hmm. It's there: >> >> >> >> "The following function compares two Unicode strings of possibly different >> lengths.

Re: [sqlite] Suggestion about hard-coded time string format YYYY-MM-DD

2012-04-02 Thread Nico Williams
On Mon, Apr 2, 2012 at 1:25 PM, Richard Hipp wrote: > On Mon, Apr 2, 2012 at 2:03 PM, Simon Slavin wrote: >> I think ... a higher priority than that would be handling Unicode >> correctly.  And having Unicode support would be useful in writing the code >> which handles dates. >> > size of SQLite

Re: [sqlite] Suggestion about hard-coded time string format YYYY-MM-DD

2012-04-02 Thread Nico Williams
On Mon, Apr 2, 2012 at 4:24 PM, Simon Slavin wrote: > On 2 Apr 2012, at 9:58pm, Alexey Pechnikov wrote: >> Description: Unicode string library for C >> The 'libunistring' library implements Unicode strings (in the UTF-8, >> UTF-16, and UTF-32 encodings), together with functions for >> Unicode cha

Re: [sqlite] Suggestion about hard-coded time string format YYYY-MM-DD

2012-04-02 Thread Jean-Christophe Deschamps
At 23:44 02/04/2012, you wrote: I wonder whether it respects languages. These don't, but u8_strcoll et al supposedly do, based on LC_COLLATE locale category. Herein lies the problem: if you build an index using these functions while running under locale A, then try to run queries against t

Re: [sqlite] Suggestion about hard-coded time string format YYYY-MM-DD

2012-04-02 Thread Igor Tandetnik
On 4/2/2012 5:34 PM, Simon Slavin wrote: Hmm. It's there: "The following function compares two Unicode strings of possibly different lengths. — Function: int u8_cmp2 (const uint8_t *s1, size_t n1, const uint8_t

Re: [sqlite] Suggestion about hard-coded time string format YYYY-MM-DD

2012-04-02 Thread Simon Slavin
On 2 Apr 2012, at 10:24pm, Simon Slavin wrote: > On 2 Apr 2012, at 9:58pm, Alexey Pechnikov wrote: > >> Description: Unicode string library for C >> The 'libunistring' library implements Unicode strings (in the UTF-8, >> UTF-16, and UTF-32 encodings), together with functions for >> Unicode cha

Re: [sqlite] Suggestion about hard-coded time string format YYYY-MM-DD

2012-04-02 Thread Simon Slavin
On 2 Apr 2012, at 9:58pm, Alexey Pechnikov wrote: > Description: Unicode string library for C > The 'libunistring' library implements Unicode strings (in the UTF-8, > UTF-16, and UTF-32 encodings), together with functions for > Unicode characters (character names, classifications, properties) an

Re: [sqlite] Suggestion about hard-coded time string format YYYY-MM-DD

2012-04-02 Thread Nico Williams
On Mon, Apr 2, 2012 at 3:58 PM, Alexey Pechnikov wrote: > And see too: > > Homepage: http://www.gnu.org/software/libunistring/ Thanks! That looks like a dream come true (even if LGPL). It's much more complete than the OpenSolaris u8_textprep stuff, which would be particularly useful for SQLite3

Re: [sqlite] Suggestion about hard-coded time string format YYYY-MM-DD

2012-04-02 Thread Alexey Pechnikov
And see too: # LANG=C aptitude show libunistring0 Package: libunistring0 New: yes State: not installed Version: 0.9.3-3 Priority: optional Section: libs Maintainer: Andreas Rottmann Uncompressed Size: 1221 k Depends: libc6 (>= 2.3) Description: Unicode string library for C The 'libunistring' lib

Re: [sqlite] Suggestion about hard-coded time string format YYYY-MM-DD

2012-04-02 Thread Nico Williams
On Mon, Apr 2, 2012 at 1:25 PM, Richard Hipp wrote: > On Mon, Apr 2, 2012 at 2:03 PM, Simon Slavin wrote: >> I think ... a higher priority than that would be handling Unicode >> correctly.  And having Unicode support would be useful in writing the code >> which handles dates. >> >> > size of SQLi

Re: [sqlite] Suggestion about hard-coded time string format YYYY-MM-DD

2012-04-02 Thread Simon Slavin
On 2 Apr 2012, at 7:25pm, Richard Hipp wrote: > On Mon, Apr 2, 2012 at 2:03 PM, Simon Slavin wrote: > >> I think ... a higher priority than that would be handling Unicode >> correctly. And having Unicode support would be useful in writing the code >> which handles dates. > > size of SQLite l

Re: [sqlite] Suggestion about hard-coded time string format YYYY-MM-DD

2012-04-02 Thread Alexey Pechnikov
Why you need ICU library to parse datetime strings?!! The my previous patch to parse Russian dates has only single row without any external libs. 2012/4/2 Richard Hipp > On Mon, Apr 2, 2012 at 2:03 PM, Simon Slavin wrote: > > > > > I think ... a higher priority than that would be handling Unico

Re: [sqlite] Suggestion about hard-coded time string format YYYY-MM-DD

2012-04-02 Thread Richard Hipp
On Mon, Apr 2, 2012 at 2:03 PM, Simon Slavin wrote: > > I think ... a higher priority than that would be handling Unicode > correctly. And having Unicode support would be useful in writing the code > which handles dates. > > size of SQLite library: approx 500 KB size of ICU library: approx 21,9

Re: [sqlite] Suggestion about hard-coded time string format YYYY-MM-DD

2012-04-02 Thread Simon Slavin
On 2 Apr 2012, at 6:18pm, Alexey Pechnikov wrote: > Please see http://www.sqlite.org/lang_datefunc.html and you will be > frustrated because SQLite can format date/time to different string formats > but can't read the produced date/time strings. I am not frustrated. That function does not requ

Re: [sqlite] Suggestion about hard-coded time string format YYYY-MM-DD

2012-04-02 Thread Alexey Pechnikov
> 2012/4/2 Simon Slavin Please see http://www.sqlite.org/lang_datefunc.html and you will be frustrated because SQLite can format date/time to different string formats but can't read the produced date/time strings. -- Best regards, Alexey Pechnikov. http://pechnikov.tel/

Re: [sqlite] Suggestion about hard-coded time string format YYYY-MM-DD

2012-04-02 Thread Jay A. Kreibich
On Mon, Apr 02, 2012 at 08:38:37PM +0400, Alexey Pechnikov scratched on the wall: > Why we can't control this? As example, in Russia the date format is > DD.MM. and is needed the patch > http://sqlite.mobigroup.ru/fdiff?v1=288ad2e1e017565c&v2=720cb1015e95af7a > > I think the new pragmas DATEF

Re: [sqlite] Suggestion about hard-coded time string format YYYY-MM-DD

2012-04-02 Thread Simon Slavin
On 2 Apr 2012, at 5:38pm, Alexey Pechnikov wrote: > Why we can't control this? As example, in Russia the date format is > DD.MM. and is needed the patch > http://sqlite.mobigroup.ru/fdiff?v1=288ad2e1e017565c&v2=720cb1015e95af7a > > I think the new pragmas DATEFORMAT and TIMEFORMAT will be h

[sqlite] Suggestion about hard-coded time string format YYYY-MM-DD

2012-04-02 Thread Alexey Pechnikov
Why we can't control this? As example, in Russia the date format is DD.MM. and is needed the patch http://sqlite.mobigroup.ru/fdiff?v1=288ad2e1e017565c&v2=720cb1015e95af7a I think the new pragmas DATEFORMAT and TIMEFORMAT will be helpful for internationalization. These may be used for parsing