Created
February 18, 2012 01:19
-
-
Save bpanulla/1856719 to your computer and use it in GitHub Desktop.
Loading structured non-SQLified data into PostgreSQL from <stdin>
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$sql = "copy myTable ( …lots fields …) from STDIN with null as '' delimiter '\t'" | |
zcat mydata.txt.gz | psql -U myUser myDB -c "$sql" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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