Vacuum:vacuum is a useful command to maintain PostGreSql database integrity. Also, it permanently removes deleted database records (by default PostGreSql does not delete permanently). It also rearranges page tables, segments for better performance. vacuum should be run regularly for optimized performance. You can also automate the execution.
Syntax: vacuum [FULL|Analyze|Verbose|table name]
Example:
vacuum member verbose
vacuum full
vacuum analyze full
vacuum also has linux command line command like
vacuumdb dbname
vacuum -a -f -v -z
——–
PostGreSql maintains a list of databases in the pg_database system table. Sometimes when it/the table gets corrupted, a full vacuum on all databases may fix the issue. When the table gets corrupted many operations like pg_dump may not work and you may get error messages like missing entry in the pg_database table.
———-
Backup command:
pg_dump options dbname > destination txt/tar file
Example: pg_dump -Ft -b mydb > db.tar
Restore Command:
Example: pg_restore -d newdb db.tar
————–
Linux and PostGreSQL
commands to access PostGreSql:
su – postgres
password:
psql -l : list all databases
——–
From: http://sitestree.com/?p=4805
Categories:39
Tags:
Post Data:2012-09-16 12:23:46
Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
(Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a>
In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
<a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>
