Skip to content

Instantly share code, notes, and snippets.

@bpanulla
Created February 18, 2012 01:19
Show Gist options
  • Save bpanulla/1856719 to your computer and use it in GitHub Desktop.
Save bpanulla/1856719 to your computer and use it in GitHub Desktop.
Loading structured non-SQLified data into PostgreSQL from <stdin>
$sql = "copy myTable ( …lots fields …) from STDIN with null as '' delimiter '\t'"
zcat mydata.txt.gz | psql -U myUser myDB -c "$sql"
@bpanulla
Copy link
Author

Here's a method to do it in MySQL using a named pipe intermediary:
http://forums.mysql.com/read.php?20,94309,151288#msg-151288

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment