Gene muy rápidamente les voy a decir como solucioné este tema, el problema es que quiero “linkear” por nombre pero en distintas tablas difieren los acentos. Entonces como indican en este post, creamos una función:
01 | CREATE OR REPLACE FUNCTION <strong>unaccent_string</strong>(text) |
09 | 'áãäåāăąÁÂÃÄÅĀĂĄèééêëēĕėęěĒĔĖĘĚìíîïìĩīĭÌÍÎÏÌĨĪĬóôõöōŏőÒÓÔÕÖŌŎŐùúûüũūŭůÙÚÛÜŨŪŬŮ' , |
10 | 'aaaaaaaaaaaaaaaeeeeeeeeeeeeeeeiiiiiiiiiiiiiiiiooooooooooooooouuuuuuuuuuuuuuuu' |
Me gustó la escrita en sql porque su compatibilidad y sencilles sobre todo, ahora solo tenemos que hacer algo como:
update regiones set the_geom = (select the_geom from barrios where unaccent_string(barrios.nombre) = unaccent_string(regiones.nombre)) where idtiporegiones = 11;
Y con eso debería andar. Espero les sirva.
Tags: acentos, comparación con acentos, postgres, sacar acentos, sql, strip acentos
This entry was posted on Thursday, August 5th, 2010 at 10:27 pm and is filed under Servidores Linux, SIG. You can follow any responses to this entry through the RSS 2.0 feed.
Both comments and pings are currently closed.
Gracias!, funciona perfecto.