Skip to content

Support data input using COPY and STDIN #80

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
chowey opened this issue Dec 13, 2011 · 5 comments
Closed

Support data input using COPY and STDIN #80

chowey opened this issue Dec 13, 2011 · 5 comments

Comments

@chowey
Copy link
Contributor

chowey commented Dec 13, 2011

I am sitting here with a bunch of data to sift through, process, and insert into a postgres database.

It occurs to me that this could be done with a bunch of statements like this:

INSERT INTO my_table VALUES
    ('some', 'data', 'to', 'input'),
    ('another', 'row', 'to', 'add');

OR I could use something like this:

COPY my_table FROM STDIN;

and then stream my data in through stdin.

Is this easy to do? Does the pg socket act like stdin? Could we get commands like

  • var readableStream = client.copyFrom(table_name, options) and
  • var writableStream = client.copyTo(table_name, options)?

Is this really not very useful?

@brianc
Copy link
Owner

brianc commented Dec 15, 2011

I think it is useful. I'd be interested in discussing the API a bit more, and it's on my longer term mental roadmap of things to implement. Currently what I'd like to do is:

  • Refactor tests to get them using mocha, don't use make because it's not on windows
  • Run tests (at least the unit test portion) on travis CI
  • Implement full support for TSL/SSL connections in both native & pure js clients
  • CopyIn/CopyOut
  • Better Binary result parsing support
  • More and better documentation

As far as the exact API for copyin/copyout I'll need to read the Postgres client protocol spec. There are some things you have to "do" to prepare for and handle copyin/copyout. I like where you're going with returning a stream object for the copyin/copyout operations.

@chowey
Copy link
Contributor Author

chowey commented Dec 15, 2011

Thanks. It's nice to see the roadmap.

@bzmw
Copy link

bzmw commented Oct 15, 2012

An implementation of COPY and STDIN would be very helpful.
Has there been any progress on this in the last 10 months?

@jmarca
Copy link

jmarca commented Oct 30, 2012

related to issue #7

@brianc
Copy link
Owner

brianc commented Jan 6, 2013

#232 closed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants