Services
24×7×365 Technical Support
Migration to PostgreSQL
High Availability Deployment
Database Audit
Remote DBA for PostgreSQL
Products
Postgres Pro Enterprise
Postgres Pro Standard
Cloud Solutions
Postgres Extensions
Resources
Blog
Documentation
Webinars
Videos
Presentations
Community
Events
Training Courses
Books
Demo Database
Mailing List Archives
About
Leadership team
Partners
Customers
In the News
Press Releases
Press Info
Services
24×7×365 Technical Support
Migration to PostgreSQL
High Availability Deployment
Database Audit
Remote DBA for PostgreSQL
Products
Postgres Pro Enterprise
Postgres Pro Standard
Cloud Solutions
Postgres Extensions
Resources
Blog
Documentation
Webinars
Videos
Presentations
Community
Events
Training Courses
Books
Demo Database
Mailing List Archives
About
Leadership team
Partners
Customers
In the News
Press Releases
Press Info
Facebook
Downloads
Home
>
mailing lists
psql - better support pipe line - Mailing list pgsql-hackers
From
Pavel Stehule
Subject
psql - better support pipe line
Date
August 24, 2015
08:07:08
Msg-id
CAFj8pRBdu3uTC6wJefy5f_qNzn2Dr1ReGwc9Ey_wzVyggWo+rQ@mail.gmail.com
Whole thread
Raw
Responses
Re: psql - better support pipe line
List
pgsql-hackers
Tree view
Hi
I found so a set "psql" and "xargs" is pretty strong. But I miss a psql option for simple returning current database and continuing in pipeline.
What I am doing:
psql postgres -At -c "select datname from pg_database" |
xargs -P 3 -I % psql % -At -c "select current_databe() from pg_stat_all_tables
where relname = 'pg_attribute' and n_dead_tup > 100000" |
xargs -P 3 -I % sh -c "psql % -q -c 'analyze pg_attribute'; echo %" |
xargs -P 3 -I % psql % -At -c "select curren_database() from ..."
it works perfectly - but the line
xargs -P 3 -I % sh -c "psql % -q -c 'analyze pg_attribute'; echo %"
is little bit ugly - with some psql option it can be cleaned to
xargs -P3 -I % psql % -q --echo-db -c "analyze pg_attribute" | ...
--echo-db requires -q option
What are you thinking about this idea?
Regards
Pavel
pgsql-hackers
by date:
Previous
From:
Amit Kapila
Date:
24 August 2015, 06:43:18
Subject:
Re: checkpointer continuous flushing
Next
From:
Stefan Kaltenbrunner
Date:
24 August 2015, 09:33:33
Subject:
Re: (full) Memory context dump considered harmful
Есть вопросы? Напишите нам!
Соглашаюсь с условиями обработки персональных данных
I confirm that I have read and accepted PostgresPro’s
Privacy Policy
.
I agree to get Postgres Pro discount offers and other marketing communications.
✖
×
×
Everywhere
Documentation
Mailing list
List:
all lists
pgsql-general
pgsql-hackers
buildfarm-members
pgadmin-hackers
pgadmin-support
pgsql-admin
pgsql-advocacy
pgsql-announce
pgsql-benchmarks
pgsql-bugs
pgsql-chat
pgsql-cluster-hackers
pgsql-committers
pgsql-cygwin
pgsql-docs
pgsql-hackers-pitr
pgsql-hackers-win32
pgsql-interfaces
pgsql-jdbc
pgsql-jobs
pgsql-novice
pgsql-odbc
pgsql-patches
pgsql-performance
pgsql-php
pgsql-pkg-debian
pgsql-pkg-yum
pgsql-ports
pgsql-rrreviewers
pgsql-ru-general
pgsql-sql
pgsql-students
pgsql-testers
pgsql-translators
pgsql-www
psycopg
Period
anytime
within last day
within last week
within last month
within last 6 months
within last year
Sort by
date
reverse date
rank
Services
24×7×365 Technical Support
Migration to PostgreSQL
High Availability Deployment
Database Audit
Remote DBA for PostgreSQL
Products
Postgres Pro Enterprise
Postgres Pro Standard
Cloud Solutions
Postgres Extensions
Resources
Blog
Documentation
Webinars
Videos
Presentations
Community
Events
Training Courses
Books
Demo Database
Mailing List Archives
About
Leadership team
Partners
Customers
In the News
Press Releases
Press Info
By continuing to browse this website, you agree to the use of cookies. Go to
Privacy Policy
.
I accept cookies