copy/dump database to text/csv files

From: William Nolf <bnolf(at)xceleratesolutions(dot)com>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: copy/dump database to text/csv files
Date: 2014-07-24 19:04:14
Message-ID: 1406228653076.32262@xceleratesolutions.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

This is probably an easy one for most sql users but I don't use it very often.

We have a postgres database that was used for an application we no longer use. However, we would

like to copy/dump the tables to files, text or csv so we can post them to sharepoint.

Copy seems to be what I want. But it only does one table at a time. There is 204 tables with a schemaname=public. I need to be copy the tables with data to files. I need something like a for

loop which checks if the table is populated if so, copy it to tablename.csv file

Any ideas?

thanks

Bill Nolf | Sr. Linux Engineer (RHCE)

[https://xceleratesolution.sharepoint.com/Shared%20Documents/Xcelerate%20Logos/xCelerate-Logo-(W-Solutions).jpg]
8401 Greensboro Dr. #930
McLean, VA 22102
O: 703-275-8461

Responses

Browse pgsql-general by date

  From Date Subject
Next Message John R Pierce 2014-07-24 19:13:56 Re: copy/dump database to text/csv files
Previous Message Seref Arikan 2014-07-24 17:51:29 Re: Are queries run completely before a Cursor can be used?