pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From latin9 to sql_ascii??
11+ messages / 4 participants
[nested] [flat]

* From latin9 to sql_ascii??
@ 2004-12-13 19:43 Jaime Casanova <systemguards@yahoo.com>
  2004-12-13 22:20 ` Re: From latin9 to sql_ascii?? Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 11+ messages in thread

From: Jaime Casanova @ 2004-12-13 19:43 UTC (permalink / raw)
  To: pgsql-admin

Hi,

someone show me that if had accents in a word i can
suppress it with the to_ascii function.

=> select to_ascii('Jiménez');

will retrieve 'Jimenez' at least it works on Latin1
encoding.

Why it not work on Latin9, there's another way of
doing such a thing?

regards,
Jaime Casanova

_________________________________________________________
Do You Yahoo!?
Información de Estados Unidos y América Latina, en Yahoo! Noticias.
Visítanos en http://noticias.espanol.yahoo.com



^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: From latin9 to sql_ascii??
  2004-12-13 19:43 From latin9 to sql_ascii?? Jaime Casanova <systemguards@yahoo.com>
@ 2004-12-13 22:20 ` Tom Lane <tgl@sss.pgh.pa.us>
  2004-12-14 21:26   ` Re: From latin9 to sql_ascii?? Jaime Casanova <systemguards@yahoo.com>
  0 siblings, 1 reply; 11+ messages in thread

From: Tom Lane @ 2004-12-13 22:20 UTC (permalink / raw)
  To: Jaime Casanova <systemguards@yahoo.com>; +Cc: pgsql-admin

Jaime Casanova <systemguards@yahoo.com> writes:
> => select to_ascii('Jiménez');
> will retrieve 'Jimenez' at least it works on Latin1
> encoding.

> Why it not work on Latin9,

Probably because it hasn't got a table for Latin9.  Feel free to
contribute one --- see src/backend/utils/adt/ascii.c.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: From latin9 to sql_ascii??
  2004-12-13 19:43 From latin9 to sql_ascii?? Jaime Casanova <systemguards@yahoo.com>
  2004-12-13 22:20 ` Re: From latin9 to sql_ascii?? Tom Lane <tgl@sss.pgh.pa.us>
@ 2004-12-14 21:26   ` Jaime Casanova <systemguards@yahoo.com>
  2004-12-17 21:03     ` Re: From latin9 to sql_ascii?? Jaime Casanova <systemguards@yahoo.com>
  0 siblings, 1 reply; 11+ messages in thread

From: Jaime Casanova @ 2004-12-14 21:26 UTC (permalink / raw)
  To: pgsql-admin

 --- Tom Lane <tgl@sss.pgh.pa.us> escribió: 
> Jaime Casanova <systemguards@yahoo.com> writes:
> > => select to_ascii('Jiménez');
> > will retrieve 'Jimenez' at least it works on
> Latin1
> > encoding.
> 
> > Why it not work on Latin9,
> 
> Probably because it hasn't got a table for Latin9. 
> Feel free to
> contribute one --- see
> src/backend/utils/adt/ascii.c.
> 

I will be pleased of, if i can understand this.
Can you tell me where i can found info about this
issue?

regards,
Jaime Casanova

_________________________________________________________
Do You Yahoo!?
Información de Estados Unidos y América Latina, en Yahoo! Noticias.
Visítanos en http://noticias.espanol.yahoo.com



^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: From latin9 to sql_ascii??
  2004-12-13 19:43 From latin9 to sql_ascii?? Jaime Casanova <systemguards@yahoo.com>
  2004-12-13 22:20 ` Re: From latin9 to sql_ascii?? Tom Lane <tgl@sss.pgh.pa.us>
  2004-12-14 21:26   ` Re: From latin9 to sql_ascii?? Jaime Casanova <systemguards@yahoo.com>
@ 2004-12-17 21:03     ` Jaime Casanova <systemguards@yahoo.com>
  2004-12-17 21:21       ` Re: From latin9 to sql_ascii?? Tom Lane <tgl@sss.pgh.pa.us>
  2004-12-17 22:09       ` Re: From latin9 to sql_ascii?? Peter Eisentraut <peter_e@gmx.net>
  0 siblings, 2 replies; 11+ messages in thread

From: Jaime Casanova @ 2004-12-17 21:03 UTC (permalink / raw)
  To: pgsql-patches@postgresql.org

 --- Jaime Casanova <systemguards@yahoo.com> escribió:

>  --- Tom Lane <tgl@sss.pgh.pa.us> escribió: 
>> Jaime Casanova <systemguards@yahoo.com> writes:
>>> => select to_ascii('Jiménez');
>>> will retrieve 'Jimenez' at least it works on
>>> Latin1 encoding.
>>> 
>>> Why it not work on Latin9,
>> 
>> Probably because it hasn't got a table for Latin9.
>> 
>> Feel free to contribute one --- see 
>> src/backend/utils/adt/ascii.c.

This page shows the differences between Latin1 &
Latin9:
http://www.cs.tut.fi/~jkorpela/latin9.html

The diffs are:

164: the euro symbol.           (sql_ascii = 'E')???
166: an S with a symbol above   (sql_ascii = 'S')
168: the same but lower case    (sql_ascii = 's')
180: an Z with a symbol above   (sql_ascii = 'Z')
184: the same but lower case    (sql_ascii = 'z')
188: it's an O merge with an E  (sql_ascii =  '')???
189: the same but lower case    (sql_ascii =  '')???
190: an Y with a 2 points above (sql_ascii = 'Y')

Comments? 

regards,
Jaime Casanova 

_________________________________________________________
Do You Yahoo!?
Información de Estados Unidos y América Latina, en Yahoo! Noticias.
Visítanos en http://noticias.espanol.yahoo.com

Attachments:

ascii.patch (application/octet-stream, 612B) download *** src/backend/utils/adt/ascii.c.orig 2004-12-17 15:16:29.000000000 -0500 --- src/backend/utils/adt/ascii.c 2004-12-17 15:18:29.000000000 -0500 *************** *** 53,58 **** --- 53,66 ---- ascii = " A L LS \"SSTZ-ZZ a,l'ls ,sstz\"zzRAAAALCCCEEEEIIDDNNOOOOxRUUUUYTBraaaalccceeeeiiddnnoooo/ruuuuyt."; range = RANGE_160; } + else if (enc == PG_LATIN9) + { + /* + * ISO-8859-15 <range: 160 -- 255> + */ + ascii = " cLEYS sCa -R Zu .z EeY?AAAAAAACEEEEIIII NOOOOOxOUUUUYTBaaaaaaaceeeeiiii nooooo/ouuuuyty"; + range = RANGE_160; + } else if (enc == PG_WIN1250) { /*
^ permalink raw reply [nested|flat] 11+ messages in thread

* Re: From latin9 to sql_ascii??
  2004-12-13 19:43 From latin9 to sql_ascii?? Jaime Casanova <systemguards@yahoo.com>
  2004-12-13 22:20 ` Re: From latin9 to sql_ascii?? Tom Lane <tgl@sss.pgh.pa.us>
  2004-12-14 21:26   ` Re: From latin9 to sql_ascii?? Jaime Casanova <systemguards@yahoo.com>
  2004-12-17 21:03     ` Re: From latin9 to sql_ascii?? Jaime Casanova <systemguards@yahoo.com>
@ 2004-12-17 21:21       ` Tom Lane <tgl@sss.pgh.pa.us>
  2004-12-18 04:33         ` Re: From latin9 to sql_ascii?? Jaime Casanova <systemguards@yahoo.com>
  1 sibling, 1 reply; 11+ messages in thread

From: Tom Lane @ 2004-12-17 21:21 UTC (permalink / raw)
  To: Jaime Casanova <systemguards@yahoo.com>; +Cc: pgsql-patches@postgresql.org

Jaime Casanova <systemguards@yahoo.com> writes:
> Why it not work on Latin9,

>> Probably because it hasn't got a table for Latin9.
>> 
>> Feel free to contribute one --- see 
>> src/backend/utils/adt/ascii.c.

> This page shows the differences between Latin1 &
> Latin9:
> http://www.cs.tut.fi/~jkorpela/latin9.html

> The diffs are:

> 164: the euro symbol.           (sql_ascii = 'E')???
> 166: an S with a symbol above   (sql_ascii = 'S')
> 168: the same but lower case    (sql_ascii = 's')
> 180: an Z with a symbol above   (sql_ascii = 'Z')
> 184: the same but lower case    (sql_ascii = 'z')
> 188: it's an O merge with an E  (sql_ascii =  '')???
> 189: the same but lower case    (sql_ascii =  '')???
> 190: an Y with a 2 points above (sql_ascii = 'Y')

> Comments? 

Works for me.  Anyone feel this is too big a change to push into 8.0?
Strictly speaking it's a new feature, but it sure looks harmless from
here.

Personally I'd say that the euro symbol should map to ' ' not 'E',
but am not set on that.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: From latin9 to sql_ascii??
  2004-12-13 19:43 From latin9 to sql_ascii?? Jaime Casanova <systemguards@yahoo.com>
  2004-12-13 22:20 ` Re: From latin9 to sql_ascii?? Tom Lane <tgl@sss.pgh.pa.us>
  2004-12-14 21:26   ` Re: From latin9 to sql_ascii?? Jaime Casanova <systemguards@yahoo.com>
  2004-12-17 21:03     ` Re: From latin9 to sql_ascii?? Jaime Casanova <systemguards@yahoo.com>
  2004-12-17 21:21       ` Re: From latin9 to sql_ascii?? Tom Lane <tgl@sss.pgh.pa.us>
@ 2004-12-18 04:33         ` Jaime Casanova <systemguards@yahoo.com>
  2004-12-20 19:01           ` Re: From latin9 to sql_ascii?? Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 11+ messages in thread

From: Jaime Casanova @ 2004-12-18 04:33 UTC (permalink / raw)
  To: pgsql-patches@postgresql.org

 --- Tom Lane <tgl@sss.pgh.pa.us> escribió: 
> Jaime Casanova <systemguards@yahoo.com> writes:
> > Why it not work on Latin9,
> 
> >> Probably because it hasn't got a table for
> Latin9.
> >> 
> >> Feel free to contribute one --- see 
> >> src/backend/utils/adt/ascii.c.
> 
> > This page shows the differences between Latin1 &
> > Latin9:
> > http://www.cs.tut.fi/~jkorpela/latin9.html
> 
> > The diffs are:
> 
> > 164: the euro symbol.           (sql_ascii =
> 'E')???
> > 166: an S with a symbol above   (sql_ascii = 'S')
> > 168: the same but lower case    (sql_ascii = 's')
> > 180: an Z with a symbol above   (sql_ascii = 'Z')
> > 184: the same but lower case    (sql_ascii = 'z')
> > 188: it's an O merge with an E  (sql_ascii = 
> '')???
> > 189: the same but lower case    (sql_ascii = 
> '')???
> > 190: an Y with a 2 points above (sql_ascii = 'Y')
> 
> > Comments? 
> 
> Works for me.  Anyone feel this is too big a change
> to push into 8.0?
> Strictly speaking it's a new feature, but it sure
> looks harmless from here.

You guys have the code, you guys have the power.
I don't think it can cause any problem. :)

> 
> Personally I'd say that the euro symbol should map
> to ' ' not 'E', but am not set on that.
> 

Maybe, someone that uses the euro symbol can comment??
if not, and you said that we can just map that symbol
to ' '.

Here's the *fixed* patch it's up to you wich one to
use.

regards,
Jaime Casanova



_________________________________________________________
Do You Yahoo!?
Información de Estados Unidos y América Latina, en Yahoo! Noticias.
Visítanos en http://noticias.espanol.yahoo.com

Attachments:

ascii2.patch (text/plain, 604B) download *** src/backend/utils/adt/ascii.c.orig 2004-08-29 00:06:49.000000000 -0500 --- src/backend/utils/adt/ascii.c 2004-12-17 23:02:01.000000000 -0500 *************** *** 53,58 **** --- 53,66 ---- ascii = " A L LS \"SSTZ-ZZ a,l'ls ,sstz\"zzRAAAALCCCEEEEIIDDNNOOOOxRUUUUYTBraaaalccceeeeiiddnnoooo/ruuuuyt."; range = RANGE_160; } + else if (enc == PG_LATIN9) + { + /* + * ISO-8859-15 <range: 160 -- 255> + */ + ascii = " cL YS sCa -R Zu .z EeY?AAAAAAACEEEEIIII NOOOOOxOUUUUYTBaaaaaaaceeeeiiii nooooo/ouuuuyty"; + range = RANGE_160; + } else if (enc == PG_WIN1250) { /*
^ permalink raw reply [nested|flat] 11+ messages in thread

* Re: From latin9 to sql_ascii??
  2004-12-13 19:43 From latin9 to sql_ascii?? Jaime Casanova <systemguards@yahoo.com>
  2004-12-13 22:20 ` Re: From latin9 to sql_ascii?? Tom Lane <tgl@sss.pgh.pa.us>
  2004-12-14 21:26   ` Re: From latin9 to sql_ascii?? Jaime Casanova <systemguards@yahoo.com>
  2004-12-17 21:03     ` Re: From latin9 to sql_ascii?? Jaime Casanova <systemguards@yahoo.com>
  2004-12-17 21:21       ` Re: From latin9 to sql_ascii?? Tom Lane <tgl@sss.pgh.pa.us>
  2004-12-18 04:33         ` Re: From latin9 to sql_ascii?? Jaime Casanova <systemguards@yahoo.com>
@ 2004-12-20 19:01           ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 11+ messages in thread

From: Tom Lane @ 2004-12-20 19:01 UTC (permalink / raw)
  To: Jaime Casanova <systemguards@yahoo.com>; +Cc: pgsql-patches@postgresql.org

Jaime Casanova <systemguards@yahoo.com> writes:
> Here's the *fixed* patch it's up to you wich one to
> use.

I applied this one.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: From latin9 to sql_ascii??
  2004-12-13 19:43 From latin9 to sql_ascii?? Jaime Casanova <systemguards@yahoo.com>
  2004-12-13 22:20 ` Re: From latin9 to sql_ascii?? Tom Lane <tgl@sss.pgh.pa.us>
  2004-12-14 21:26   ` Re: From latin9 to sql_ascii?? Jaime Casanova <systemguards@yahoo.com>
  2004-12-17 21:03     ` Re: From latin9 to sql_ascii?? Jaime Casanova <systemguards@yahoo.com>
@ 2004-12-17 22:09       ` Peter Eisentraut <peter_e@gmx.net>
  2004-12-17 23:19         ` Re: From latin9 to sql_ascii?? Jaime Casanova <systemguards@yahoo.com>
  2004-12-17 23:43         ` Re: From latin9 to sql_ascii?? Alvaro Herrera <alvherre@dcc.uchile.cl>
  1 sibling, 2 replies; 11+ messages in thread

From: Peter Eisentraut @ 2004-12-17 22:09 UTC (permalink / raw)
  To: Jaime Casanova <systemguards@yahoo.com>; +Cc: pgsql-patches@postgresql.org

Jaime Casanova wrote:
> 188: it's an O merge with an E  (sql_ascii =  '')???
> 189: the same but lower case    (sql_ascii =  '')???

'OE' and 'oe', most likely, but someone more familiar with French 
typography might correct me.

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/



^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: From latin9 to sql_ascii??
  2004-12-13 19:43 From latin9 to sql_ascii?? Jaime Casanova <systemguards@yahoo.com>
  2004-12-13 22:20 ` Re: From latin9 to sql_ascii?? Tom Lane <tgl@sss.pgh.pa.us>
  2004-12-14 21:26   ` Re: From latin9 to sql_ascii?? Jaime Casanova <systemguards@yahoo.com>
  2004-12-17 21:03     ` Re: From latin9 to sql_ascii?? Jaime Casanova <systemguards@yahoo.com>
  2004-12-17 22:09       ` Re: From latin9 to sql_ascii?? Peter Eisentraut <peter_e@gmx.net>
@ 2004-12-17 23:19         ` Jaime Casanova <systemguards@yahoo.com>
  1 sibling, 0 replies; 11+ messages in thread

From: Jaime Casanova @ 2004-12-17 23:19 UTC (permalink / raw)
  To: pgsql-patches@postgresql.org

 --- Peter Eisentraut <peter_e@gmx.net> escribió: 
> Jaime Casanova wrote:
> > 188: it's an O merge with an E  (sql_ascii = 
> '')???
> > 189: the same but lower case    (sql_ascii = 
> '')???
> 
> 'OE' and 'oe', most likely, but someone more
> familiar with French 
> typography might correct me.
> 

Something like that, i really doesn't know how to
convert to sql_ascii that.

Maybe just blank like Tom suggest about the euro
symbol

regards, 
Jaime Casanova

_________________________________________________________
Do You Yahoo!?
Información de Estados Unidos y América Latina, en Yahoo! Noticias.
Visítanos en http://noticias.espanol.yahoo.com



^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: From latin9 to sql_ascii??
  2004-12-13 19:43 From latin9 to sql_ascii?? Jaime Casanova <systemguards@yahoo.com>
  2004-12-13 22:20 ` Re: From latin9 to sql_ascii?? Tom Lane <tgl@sss.pgh.pa.us>
  2004-12-14 21:26   ` Re: From latin9 to sql_ascii?? Jaime Casanova <systemguards@yahoo.com>
  2004-12-17 21:03     ` Re: From latin9 to sql_ascii?? Jaime Casanova <systemguards@yahoo.com>
  2004-12-17 22:09       ` Re: From latin9 to sql_ascii?? Peter Eisentraut <peter_e@gmx.net>
@ 2004-12-17 23:43         ` Alvaro Herrera <alvherre@dcc.uchile.cl>
  2004-12-18 04:57           ` Re: From latin9 to sql_ascii?? Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 1 reply; 11+ messages in thread

From: Alvaro Herrera @ 2004-12-17 23:43 UTC (permalink / raw)
  To: Peter Eisentraut <peter_e@gmx.net>; +Cc: Jaime Casanova <systemguards@yahoo.com>; pgsql-patches@postgresql.org

On Fri, Dec 17, 2004 at 11:09:17PM +0100, Peter Eisentraut wrote:
> Jaime Casanova wrote:
> > 188: it's an O merge with an E  (sql_ascii =  '')???
> > 189: the same but lower case    (sql_ascii =  '')???
> 
> 'OE' and 'oe', most likely, but someone more familiar with French 
> typography might correct me.

OE and oe would be correct, but we can't do that with the current code.

-- 
Alvaro Herrera (<alvherre[@]dcc.uchile.cl>)
Thou shalt check the array bounds of all strings (indeed, all arrays), for
surely where thou typest "foo" someone someday shall type
"supercalifragilisticexpialidocious" (5th Commandment for C programmers)



^ permalink  raw  reply  [nested|flat] 11+ messages in thread

* Re: From latin9 to sql_ascii??
  2004-12-13 19:43 From latin9 to sql_ascii?? Jaime Casanova <systemguards@yahoo.com>
  2004-12-13 22:20 ` Re: From latin9 to sql_ascii?? Tom Lane <tgl@sss.pgh.pa.us>
  2004-12-14 21:26   ` Re: From latin9 to sql_ascii?? Jaime Casanova <systemguards@yahoo.com>
  2004-12-17 21:03     ` Re: From latin9 to sql_ascii?? Jaime Casanova <systemguards@yahoo.com>
  2004-12-17 22:09       ` Re: From latin9 to sql_ascii?? Peter Eisentraut <peter_e@gmx.net>
  2004-12-17 23:43         ` Re: From latin9 to sql_ascii?? Alvaro Herrera <alvherre@dcc.uchile.cl>
@ 2004-12-18 04:57           ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 11+ messages in thread

From: Tom Lane @ 2004-12-18 04:57 UTC (permalink / raw)
  To: Alvaro Herrera <alvherre@dcc.uchile.cl>; +Cc: Peter Eisentraut <peter_e@gmx.net>; Jaime Casanova <systemguards@yahoo.com>; pgsql-patches@postgresql.org

Alvaro Herrera <alvherre@dcc.uchile.cl> writes:
> On Fri, Dec 17, 2004 at 11:09:17PM +0100, Peter Eisentraut wrote:
>> 'OE' and 'oe', most likely, but someone more familiar with French 
>> typography might correct me.

> OE and oe would be correct, but we can't do that with the current code.

More to the point, there are no such characters in 7-bit ASCII.

I think Alvaro might be suggesting that to_ascii() should expand these
to the two-character sequences "OE" and "oe", but ISTM that opens a can
of worms better left sealed.  There are a *lot* of characters that have
translations of differing levels of plausibility into ASCII.  I'm okay
with dropping accent marks but I'm not sure about doing more than that.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 11+ messages in thread


end of thread, other threads:[~2004-12-20 19:01 UTC | newest]

Thread overview: 11+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-12-13 19:43 From latin9 to sql_ascii?? Jaime Casanova <systemguards@yahoo.com>
2004-12-13 22:20 ` Tom Lane <tgl@sss.pgh.pa.us>
2004-12-14 21:26   ` Jaime Casanova <systemguards@yahoo.com>
2004-12-17 21:03     ` Jaime Casanova <systemguards@yahoo.com>
2004-12-17 21:21       ` Tom Lane <tgl@sss.pgh.pa.us>
2004-12-18 04:33         ` Jaime Casanova <systemguards@yahoo.com>
2004-12-20 19:01           ` Tom Lane <tgl@sss.pgh.pa.us>
2004-12-17 22:09       ` Peter Eisentraut <peter_e@gmx.net>
2004-12-17 23:19         ` Jaime Casanova <systemguards@yahoo.com>
2004-12-17 23:43         ` Alvaro Herrera <alvherre@dcc.uchile.cl>
2004-12-18 04:57           ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox