pg.ddx.io pgsql-performance@postgresql.org mailing list archive
help / color / mirror / Atom feedHow to vacuum entire database excluding some tables in PostgreSQL9.1.
2+ messages / 2 participants
[nested] [flat]
* How to vacuum entire database excluding some tables in PostgreSQL9.1.
@ 2016-12-21 17:49 Dinesh Chandra 12108 <Dinesh.Chandra@cyient.com>
2016-12-21 18:16 ` Re: How to vacuum entire database excluding some tables in PostgreSQL9.1. ProPAAS DBA <dba@propaas.com>
0 siblings, 1 reply; 2+ messages in thread
From: Dinesh Chandra 12108 @ 2016-12-21 17:49 UTC (permalink / raw)
To: pgsql-performance; +Cc: Dinesh Chandra 12108 <Dinesh.Chandra@cyient.com>
Dear Expert,
Could you please suggest me for the below query?
I want to vacuum the entire database with the exception of several
tables.
Because there are some tables which are very big in size, so I just want to exclude them.
Thanks in advance.
Regards,
Dinesh Chandra
|Database administrator (Oracle/PostgreSQL)| Cyient Ltd. Noida.
------------------------------------------------------------------
Mobile: +91-9953975849 | Ext 1078 |dinesh.chandra@cyient.com<mailto:%7Cdinesh.chandra@cyient.com>
Plot No. 7, NSEZ, Phase-II ,Noida-Dadri Road, Noida - 201 305,India.
________________________________
DISCLAIMER:
This email message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. Check all attachments for viruses before opening them. All views or opinions presented in this e-mail are those of the author and may not reflect the opinion of Cyient or those of our affiliates.
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: How to vacuum entire database excluding some tables in PostgreSQL9.1.
2016-12-21 17:49 How to vacuum entire database excluding some tables in PostgreSQL9.1. Dinesh Chandra 12108 <Dinesh.Chandra@cyient.com>
@ 2016-12-21 18:16 ` ProPAAS DBA <dba@propaas.com>
0 siblings, 0 replies; 2+ messages in thread
From: ProPAAS DBA @ 2016-12-21 18:16 UTC (permalink / raw)
To: pgsql-performance
Something like this in a bash script?
#!/bin/bash
echo "select schemaname, tablename from pg_tables where tablename not in
(your list of excluded tables) and schemaname not in
('information_schema', 'pg_catalog')" | psql -t > /tmp/tablist
exec < /tmp/tablist
while read line
do
set - $line
echo "Vacuuming [$1] [$3]"
echo "VACUUM VERBOSE ${1}.${3}" | psql
done
On 12/21/2016 10:49 AM, Dinesh Chandra 12108 wrote:
>
> Dear Expert,
>
> Could you please suggest me for the below query?
>
> *I want to vacuum the entire database with the exception of several*
>
> *tables.*
>
> Because there are some tables which are very big in size, so I just
> want to exclude them.
>
> Thanks in advance.
>
> *Regards,*
>
> *Dinesh Chandra*
>
> *|Database administrator (Oracle/PostgreSQL)| Cyient Ltd. Noida.*
>
> *------------------------------------------------------------------*
>
> Mobile: +91-9953975849 | Ext 1078 |dinesh.chandra@cyient.com
> <mailto:%7Cdinesh.chandra@cyient.com>
>
> Plot No. 7, NSEZ, Phase-II ,Noida-Dadri Road, Noida - 201 305,India.
>
>
> ------------------------------------------------------------------------
>
> DISCLAIMER:
>
> This email message is for the sole use of the intended recipient(s)
> and may contain confidential and privileged information. Any
> unauthorized review, use, disclosure or distribution is prohibited. If
> you are not the intended recipient, please contact the sender by reply
> email and destroy all copies of the original message. Check all
> attachments for viruses before opening them. All views or opinions
> presented in this e-mail are those of the author and may not reflect
> the opinion of Cyient or those of our affiliates.
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2016-12-21 18:16 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-12-21 17:49 How to vacuum entire database excluding some tables in PostgreSQL9.1. Dinesh Chandra 12108 <Dinesh.Chandra@cyient.com>
2016-12-21 18:16 ` ProPAAS DBA <dba@propaas.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox