Re: CSV Utility

From: Steve Crawford <scrawford(at)pinpointresearch(dot)com>
To: Mike angelo <angelocmp(at)yahoo(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: CSV Utility
Date: 2009-08-06 21:40:16
Message-ID: 4A7B4DC0.9080509@pinpointresearch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Mike angelo wrote:
> Is there a Postgres utility that allows data contained in a CSV file
> to be loaded into the database?
>
You mean like psql?

\copy tablename from csvfilename CSV

or with a header:
\copy tablename from csvfilename CSV HEADER

or an alternate delimiter:
\copy tablename from csvfilename CSV delimiter '|'

or export data (tab-delimited):
copy foo to stdout CSV DELIMITER E'\t';

Cheers,
Steve

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Lennin Caro 2009-08-06 22:05:59 Re: Change stored procedures schema name
Previous Message Guillaume Lelarge 2009-08-06 21:30:57 Re: CSV Utility