-
Notifications
You must be signed in to change notification settings - Fork 10
Notes (Raunaq)
rawknuckles edited this page Mar 31, 2018
·
2 revisions
PGPASSWORD=pari psql -U postgres -h 127.0.0.1 -d pari -c "COPY (select title, 'article' as article, name, first_published_at, slug, language from article_article inner join wagtailcore_page on wagtailcore_page.id=article_article.page_ptr_id inner join article_article_authors on article_article_authors.article_id=article_article.page_ptr_id inner join (select article_id, name from author_author inner join article_article_authors on author_author.id=article_article_authors.author_id) author_names on article_article.page_ptr_id=author_names.article_id where live = true order by wagtailcore_page.path, first_published_at desc) TO STDOUT WITH CSV" > /tmp/pgcsv/articles.csv
PGPASSWORD=pari psql -U postgres -h 127.0.0.1 -d pari -c "COPY (select title, 'album' as album, name, first_published_at, slug, language from album_album inner join wagtailcore_page on wagtailcore_page.id=album_album.page_ptr_id inner join article_article_authors on article_article_authors.article_id=album_album.page_ptr_id inner join (select article_id, name from author_author inner join article_article_authors on author_author.id=article_article_authors.author_id) author_names on album_album.page_ptr_id=author_names.article_id where live = true order by wagtailcore_page.path, first_published_at desc) TO STDOUT WITH CSV" > /tmp/pgcsv/albums.csv
scp ubuntu@188.226.223.148:/tmp/pgcsv/articles.csv /Users/raunaq/Documents/PARI/pgcsv