Things I'm impressed by pipe
When I dump DB data I usually do this way.
pg_dump -U postgres foo > dump.sqlOr
pg_dump -U postgres foo | gzip > dump.sql.gz
Then restore it from file. (Uncompress the file if you compressed the dump data)
psql -U postgres bar < dump.sql
But, if you use pipe, you don't need to dump it to a file.
Just send stream to a new DB!!
pg_dump -U postgres foo | psql -U postgres bar
It looks not so impressive. But, let's think two databases are located on each separated servers.
you can do this.
pg_dump -U postgres -h 192.168.0.1 foo | psql -U postgres -h 192.168.0.2 bar
Oh pipe! Thank god!! Thank person who made pipe!!! :-)
(weight 89.2kg BMI 30%)
Labels: UNIX
2 Comments:
Oh my god!
hahah! I feel happy you are still alive!! yes oh my god!
Post a Comment
<< Home