Re: COMO ES EL COPY ?

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: MIGUEL CANCHAS <mcanchas(at)tsr(dot)com(dot)pe>
Cc: pgsql-es-ayuda(at)postgresql(dot)org
Subject: Re: COMO ES EL COPY ?
Date: 2008-03-07 17:02:14
Message-ID: 20080307170214.GH11041@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

MIGUEL CANCHAS escribió:
> Antes me salia el COPY, ahora no me sale como deberia ser y exactamente
> donde ?
>
> Si mi arhivo es V1.txt, y lo que hacia antes era ir hacia "C:\Archivos de
> programa\PostgreSQL\8.2\data\base\16617" (ubicaba al ojo el directorio donde
> copiar)
> siempre por DOS y le aplicaba :
>
> COPY tabla_creada_en_POSTGRESQL FROM 'v1.txt' DELIMITER '\t'
>
> y lo hacia, pero ahora no me funciona, o desde donde deberia ejecutar el
> COPY .

¿Y copias el archivo en ese directorio??? Me parece mala idea.

Te sugiero poner el archivo en alguna otra parte donde el usuario
postgres tenga acceso, y especificarle la ruta completa:

COPY tabla_creada_en_POSTGRESQL FROM 'C:\\copy\\v1.txt' DELIMITER '\t'

Ojo que necesitas doble backslash. Esto otro tambien deberia funcionar:

COPY tabla_creada_en_POSTGRESQL FROM 'C:/copy/v1.txt' DELIMITER '\t'

porque Windows traduce automaticamente los slashes en backslash.

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message MIGUEL CANCHAS 2008-03-07 17:06:31 RE: COMO ES EL COPY ?
Previous Message Edwin Quijada 2008-03-07 16:41:57 RE: Guardar archivos en Campo TEXT