{"action":"created","issue":{"url":"https://api.github.com/repos/california-civic-data-coalition/django-postgres-copy/issues/14","labels_url":"https://api.github.com/repos/california-civic-data-coalition/django-postgres-copy/issues/14/labels{/name}","comments_url":"https://api.github.com/repos/california-civic-data-coalition/django-postgres-copy/issues/14/comments","events_url":"https://api.github.com/repos/california-civic-data-coalition/django-postgres-copy/issues/14/events","html_url":"https://github.com/california-civic-data-coalition/django-postgres-copy/pull/14","id":102876550,"number":14,"title":"Use psycopg2's copy_expert so we can copy from a local file to a remote database.","user":{"login":"dcloud","id":279327,"avatar_url":"https://avatars.githubusercontent.com/u/279327?v=3","gravatar_id":"","url":"https://api.github.com/users/dcloud","html_url":"https://github.com/dcloud","followers_url":"https://api.github.com/users/dcloud/followers","following_url":"https://api.github.com/users/dcloud/following{/other_user}","gists_url":"https://api.github.com/users/dcloud/gists{/gist_id}","starred_url":"https://api.github.com/users/dcloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcloud/subscriptions","organizations_url":"https://api.github.com/users/dcloud/orgs","repos_url":"https://api.github.com/users/dcloud/repos","events_url":"https://api.github.com/users/dcloud/events{/privacy}","received_events_url":"https://api.github.com/users/dcloud/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-24T19:48:11Z","updated_at":"2015-08-25T05:24:13Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/california-civic-data-coalition/django-postgres-copy/pulls/14","html_url":"https://github.com/california-civic-data-coalition/django-postgres-copy/pull/14","diff_url":"https://github.com/california-civic-data-coalition/django-postgres-copy/pull/14.diff","patch_url":"https://github.com/california-civic-data-coalition/django-postgres-copy/pull/14.patch"},"body":"psycopg2, powers the 2 supported PostgreSQL databases engines, has a [`copy_expert` method](http://initd.org/psycopg/docs/cursor.html?highlight=copy_expert#cursor.copy_expert) which takes a file-like object rather than a path. Using this method, we are able to execute the SQL copy using local csv file and a remote database. Using the regular `execute` method requires the file_path be on the same filesystem."},"comment":{"url":"https://api.github.com/repos/california-civic-data-coalition/django-postgres-copy/issues/comments/134479601","html_url":"https://github.com/california-civic-data-coalition/django-postgres-copy/pull/14#issuecomment-134479601","issue_url":"https://api.github.com/repos/california-civic-data-coalition/django-postgres-copy/issues/14","id":134479601,"user":{"login":"palewire","id":9993,"avatar_url":"https://avatars.githubusercontent.com/u/9993?v=3","gravatar_id":"","url":"https://api.github.com/users/palewire","html_url":"https://github.com/palewire","followers_url":"https://api.github.com/users/palewire/followers","following_url":"https://api.github.com/users/palewire/following{/other_user}","gists_url":"https://api.github.com/users/palewire/gists{/gist_id}","starred_url":"https://api.github.com/users/palewire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/palewire/subscriptions","organizations_url":"https://api.github.com/users/palewire/orgs","repos_url":"https://api.github.com/users/palewire/repos","events_url":"https://api.github.com/users/palewire/events{/privacy}","received_events_url":"https://api.github.com/users/palewire/received_events","type":"User","site_admin":false},"created_at":"2015-08-25T05:24:12Z","updated_at":"2015-08-25T05:24:12Z","body":"Huh. I didn't even know this was an option in psycopg2. Looks like a great add. How could we write a unittest that would verify the remote part is working? Or is that impossible?"}}