Re: error con client_encoding

From: Hernan Valle <hernan2003a(at)gmail(dot)com>
To: José Fermín Francisco Ferreras <josefermin54(at)hotmail(dot)com>
Cc: reingart(at)gmail(dot)com, Lista PostgreSQL <pgsql-es-ayuda(at)postgresql(dot)org>
Subject: Re: error con client_encoding
Date: 2010-04-21 15:45:48
Message-ID: r2r55da970b1004210845y3798edc7l66f2d6651e3e0ae1@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

Puede ser que al final te falto lo siguiente:
CSV ESCAPE AS '"';

por ejemplo

COPY <tabla> FROM '/tmp/archiv.csv' USING DELIMITERS ',' CSV ESCAPE AS '"';

Saludos Hernán.

2010/4/21 José Fermín Francisco Ferreras <josefermin54(at)hotmail(dot)com>

>
>
> ing. José Fermín Francisco Ferreras
> San Francisco de Macorís, Rep. Dom.
>
>
>
>
> > Date: Wed, 21 Apr 2010 11:42:00 -0300
> > Subject: Re: [pgsql-es-ayuda] error con client_encoding
> > From: reingart(at)gmail(dot)com
> > To: josefermin54(at)hotmail(dot)com
> > CC: pgsql-es-ayuda(at)postgresql(dot)org
>
> >
> > On Wed, Apr 21, 2010 at 10:16 AM, José Fermín Francisco Ferreras
> > <josefermin54(at)hotmail(dot)com> wrote:
> > > Buen día, estoy por hacer un copy de un archivo CSV y a la hora de
> > > ejecutarlo me lanza el siente error:
> > >
> > > ERROR: invalid byte sequence for encoding "UTF8": 0xff
> > > HINT: This error can also happen if the byte sequence does not match
> the
> > > encoding expected by the server, which is controlled by
> "client_encoding".
> > > CONTEXT: COPY tabla, line 1
> > >
> > >
> > > ********** Error **********
> > >
> > > ERROR: invalid byte sequence for encoding "UTF8": 0xff
> > > SQL state: 22021
> > > Hint: This error can also happen if the byte sequence does not match
> the
> > > encoding expected by the server, which is controlled by
> "client_encoding".
> > > Context: COPY tabla, line 1
> > >
> > >
> > > Estos son los datos de la base de datos:
> > >
> > >
> > > CREATE DATABASE basededatos
> > > WITH OWNER = postgres
> > > ENCODING = 'LATIN1'
> > > LC_COLLATE = 'C'
> > > LC_CTYPE = 'C'
> > > CONNECTION LIMIT = -1;
> > >
> > >
> > > Sistema Operativo: windows XP
> > > Postgresql: 8.4.3
> > >
> > > Cambie el parametro: client_encoding = 'latin1', pero nada de nada.
> > >
> > > Alguien ha podido hacer algun cambio.
> > >
> > >
> >
> > Que raro,
> > ¿el script o herramienta con la que estas haciendo el COPY no estará
> > haciendo un SET client_encoding = 'UTF8'?
> >
> > Podes probar ejecutar antes del COPY un SET client_encoding = 'latin1'
> >
> > Además, podrías crear la base de datos con el encoding WIN1252, que
> > funciona mejor con aplicaciones windows legadas.
> >
> >
> http://www.arpug.com.ar/trac/wiki/PreguntasFrecuentes#ComocrearbasesdedatosconcodificaciónLatin1<http://www.arpug.com.ar/trac/wiki/PreguntasFrecuentes#Comocrearbasesdedatosconcodificaci%C3%B3nLatin1>
> >
> > Sds
> >
> > Mariano Reingart
> > http://www.arpug.com.ar
> > http://www.sistemasagiles.com.ar
> > http://reingart.blogspot.com
> > --
> > TIP 6: ¿Has buscado en los archivos de nuestra lista de correo?
> > http://archives.postgresql.org/pgsql-es-ayuda
>
>
> Gracias por tu rapida respuesta Mariano, fijate q puse lo q dijiste y ahora
> me lanza los siguiente:
>
>
> ERROR: unquoted newline found in data
> SQL state: 22P04
> Hint: Use quoted CSV field to represent newline.
> Context: COPY padron, line 2: ""
>
>
> ------------------------------
>

--

Saludos Hernán.

In response to

Responses

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Jose Antonio Garcia Torres 2010-04-21 15:53:46 Re: Salvar usuarios y roles!
Previous Message Edwin Quijada 2010-04-21 15:31:12 RE: [pgsql-es-ayuda] Ayuda con gestión de usuario restringido.