Skip site navigation (1) Skip section navigation (2)

Re: Importar datos desde un archivo CSV a una tabla de Postgre via Terminal.

From: Anthony <asotolongo(at)uci(dot)cu>
To: Cristobal Alexis Ibarra Gonzalez <cristobaal(at)gmail(dot)com>
Cc: pgsql-es-ayuda(at)postgresql(dot)org
Subject: Re: Importar datos desde un archivo CSV a una tabla de Postgre via Terminal.
Date: 2011-05-22 23:18:11
Message-ID: 4DD999B3.5070903@uci.cu (view raw or flat)
Thread:
Lists: pgsql-es-ayuda
existe el comando COPY que permite hacer lo que deseas, busca en la 
documentacion  vas a encontrar algo como esto

COPY --- copy data between a file and a table


    Synopsis

COPY/|tablename|/  [ (/|column|/  [, ...] ) ]
     FROM { '/|filename|/' | STDIN }
     [ [ WITH ]
           [ BINARY ]
           [ OIDS ]
           [ DELIMITER [ AS ] '/|delimiter|/' ]
           [ NULL [ AS ] '/|null string|/' ]
           [ CSV [ HEADER ]
                 [ QUOTE [ AS ] '/|quote|/' ]
                 [ ESCAPE [ AS ] '/|escape|/' ]
                 [ FORCE NOT NULL/|column|/  [, ...] ]

COPY {/|tablename|/  [ (/|column|/  [, ...] ) ] | (/|query|/  ) }
     TO { '/|filename|/' | STDOUT }
     [ [ WITH ]
           [ BINARY ]
           [ OIDS ]
           [ DELIMITER [ AS ] '/|delimiter|/' ]
           [ NULL [ AS ] '/|null string|/' ]
           [ CSV [ HEADER ]
                 [ QUOTE [ AS ] '/|quote|/' ]
                 [ ESCAPE [ AS ] '/|escape|/' ]
                 [ FORCE QUOTE/|column|/  [, ...] ]

In response to

Responses

pgsql-es-ayuda by date

Next:From: Álvaro Hernández TortosaDate: 2011-05-22 23:28:25
Subject: Re: Importar datos desde un archivo CSV a una tabla de Postgre via Terminal.
Previous:From: Cristobal Alexis Ibarra GonzalezDate: 2011-05-22 23:06:59
Subject: Importar datos desde un archivo CSV a una tabla de Postgre via Terminal.

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group