Re: \Copy and "Copy With Headers" -- every day these bug me.

From: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
To: John Abraham <jea(at)hbaspecto(dot)com>
Cc: pgadmin-support(at)postgresql(dot)org
Subject: Re: \Copy and "Copy With Headers" -- every day these bug me.
Date: 2012-02-19 23:05:20
Message-ID: 1329692720.2292.11.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support

On Wed, 2012-02-15 at 19:01 +0100, Guillaume Lelarge wrote:
> On Wed, 2012-02-15 at 10:36 -0700, John Abraham wrote:
> > These are two things that bug me every single day:
> >
> > 1) "\copy" equivalent. psql has \copy to copy from a local file. Using the JDBC driver I also often copy data into the database using the equivalent COPY .. FROM STDIN… With psycopg2 I also use COPY FROM STDIN to have the local python app feed the file to the postgres COPY command. In PGAdmin, however, to bulk load data into postgres we need to copy the CSV file to the computer where the database resides and fiddle with permissions until the database can read the file using COPY. This should be easy to implement, it wasn't hard for me to do it with both psycopg2 and with the JDBC driver, and psql has had it for years. The application (PGAdmin) needs to open the file and then feed the stream to the database COPY command as STDIN.
> >
>
> I agree that this doesn't appear difficult to implement. Some kind of an
> import data menu in the table's contextual menu.
>

I worked on this one all this afternoon. I now have an import window
which is capable of doing everything that COPY... FROM... does.

You can see some screenshots at:

http://developer.pgadmin.org/~guillaume/importtool/

And if you want to test it, code is available on:

https://github.com/gleu/pgadmin3/tree/importcsv

I would appreciate any comments on it before I apply it.

--
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com

In response to

Responses

Browse pgadmin-support by date

  From Date Subject
Next Message Ashesh Vashi 2012-02-20 04:50:49 Re: \Copy and "Copy With Headers" -- every day these bug me.
Previous Message Aren Cambre 2012-02-19 15:13:44 Re: Query truncated in Server Status