Re: [pgsql-es-ayuda] como exportar separado por comas una tabla grande

From: Moshe Jacobson <moshe(at)neadwerx(dot)com>
To: Alejandro Carrillo <fasterzip(at)yahoo(dot)es>
Cc: Hellmuth Vargas <hivs77(at)gmail(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: [pgsql-es-ayuda] como exportar separado por comas una tabla grande
Date: 2012-10-24 18:30:15
Message-ID: CAJ4CxLmb_PYM3nhsEHCHUAJeC2DxX-UUvycdztSHwFZ2fBtjcw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda pgsql-general

More important than the solution to this specific problem is the question
of why psql crashed when doing this export...

2012/10/24 Alejandro Carrillo <fasterzip(at)yahoo(dot)es>

> http://www.postgresql.org/docs/current/static/sql-copy.html
>
> ------------------------------
> *De:* Hellmuth Vargas <hivs77(at)gmail(dot)com>
> *Para:* Lista Postgres ES <pgsql-es-ayuda(at)postgresql(dot)org>;
> pgsql-general(at)postgresql(dot)org
> *Enviado:* Miércoles 24 de octubre de 2012 12:22
> *Asunto:* [pgsql-es-ayuda] como exportar separado por comas una tabla
> grande
>
> Hola Lista
>
> tengo una tabla con la siguiente estructura
>
> CREATE TABLE datos_para_proceso
> (
> id bigint,
> identificador character varying,
> nombre character varying(255),
> nombreusuario text,
> identificacion character varying(255),
> tema character varying(255),
> notatema text,
> subtema character varying(255),
> notasubtema text,
> pregunta character varying(255),
> notapregunta text
> )
>
> Tamaño en disco: 5585 MB
>
> ( se saco con la consulta
>
> SELECT pg_size_pretty(SUM(tamanos))
> FROM (
> SELECT pg_column_size(row(b.*)) as tamanos
> FROM (select * from datos_para_proceso) as b
> ) AS c;
> )
>
> numero de filas: 31054642
>
> Esta en una base de datos PostgreSQL 9.2 a 64 Bit en un Linux CentOS 6
>
> La idea es exportar esta tabla en formato csv, trate de hacerlo en psql
> directamente en el servidor:
>
> data=# \f '|'
> Field separator is "|".
> data=# \a
> Output format is unaligned.
> data=# \o /tmp/datos_para_proceso.csv
> data=# select * from datos_para_proceso;
> /opt/PostgreSQL/9.2/bin/psql: lí­nea 30: 9608 Terminado (killed)
> LD_PRELOAD=$PLL LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PG_BIN_PATH/../lib
> "$PG_BIN_PATH/psql.bin" "$@"
>
> Y obvio el archivo quedo vacío, como podría exportar los datos?? Muchas
> gracias lista!!!!
>
>
> --
> Cordialmente,
>
> Ing. Hellmuth I. Vargas S.
>
>
>

--
Moshe Jacobson
Nead Werx, Inc. | Senior Systems Engineer
2323 Cumberland Parkway, Suite 201 | Atlanta, GA 30339
moshe(at)neadwerx(dot)com | www.neadwerx.com

In response to

Responses

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message Hellmuth Vargas 2012-10-24 18:36:55 Re: [pgsql-es-ayuda] como exportar separado por comas una tabla grande
Previous Message Santiago Bravo 2012-10-24 18:26:19 Exportar e importar Base de Datos

Browse pgsql-general by date

  From Date Subject
Next Message Hellmuth Vargas 2012-10-24 18:36:55 Re: [pgsql-es-ayuda] como exportar separado por comas una tabla grande
Previous Message Alejandro Carrillo 2012-10-24 17:48:10 Re: [pgsql-es-ayuda] como exportar separado por comas una tabla grande