Re: Exporting Data

From: David Johnston <polobo(at)yahoo(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Exporting Data
Date: 2013-06-20 13:06:30
Message-ID: 1371733590376-5760118.post@n5.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

guilherme wrote
> I need to get some information in database and export it.
>
> Is there a way to make PostgreSQL to export one data line to a new file?
> Like this:
> 1 FIRST LINE --> line1.txt;
> 2 SECOND LINE --> line2.txt;
> 3 THIRD LINE --> line3.txt
> ...
> and so...
>
> I know that I can import all information into a unique file, but I need to
> split that information into severel files.
> I've already searched in everything and didn't find a solution.
>
> Can anybody help?
>
> Thanks in advance.

I doubt it. You should export to a single file then use another tool to
perform the split. What platform and you working on? If its Linux using
"psql | some_splitting_command" should be doable.

I guess you put your query into a function and use procedural language
functionality to do that but I'm not sure on the necessary syntax.

There may be third-party ETL tools that fulfill this need as well.

David J.

--
View this message in context: http://postgresql.1045698.n5.nabble.com/Exporting-Data-tp5760108p5760118.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Manuel Kniep 2013-06-20 13:12:46 unexpected external sort Disk
Previous Message Merlin Moncure 2013-06-20 12:52:21 Re: Postgres DB crashing