In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces "what foolish operations PostgreSQL can not do". In daily operation, I believe many people have doubts about what foolish operations PostgreSQL cannot do. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts about "what foolish operations PostgreSQL can not do". Next, please follow the editor to study!
If you work for a long time, you may sum up something that you must not do. If you do it, it will be too late.
Let's start with some of our premises.
1 has all the permissions of the database
2 you cannot destroy a database such as rm-rf by deliberate means
Then let's start making a list of actions that will make you regret it.
1 delete pg_class
Disrespectful to system tables, most databases have their own system tables, and these tables store very important information, and pg_class in pg_catalog in postgresql is a core table.
Let's see how about emptying him.
Truncate table pg_catalog.pg_class
Even if you have the initial maximum authority, PG's core list, you have no right to delete it.
But if you take a different approach,
And then you quit, and when psql connects to postgresql, you'll find that it's not OK anymore.
Pg_class is one of the most important system tables in PG, which stores the information of object and OID in the tables of all systems. after delete, pg can not provide normal services, or even connect to PG.
2 erroneous deletion of system files
There are key control files in many databases, and you can also remember the consequences of cleaning up the configuration control files. Let's delete the pg_control in PG
At this point, we set up a new database and failed.
The reason for the failure of such an operation is that the location of the checkpoint is saved in the file pg_control. Therefore, at the beginning of the restore, the server first reads the pg_control, reads the checkpoint record, and performs a redo by scanning forward from the log location specified in the checkpoint record. So after the pg_control is deleted, the work of the checkpoint that is the first checkpoint cannot continue. The overall database system can not continue to work, causing the system to crash.
Can you restart PG if you delete pg_control? Yes, but the result may not be what you want, even if you use pg_resetwal to recover the pg_control database after it can be started, but you probably get the result is
So pg_control is a control file that you can't lose.
3 clean up your template database
Template database means that even if you create the basis of other databases, such as the extended information that has been loaded in it, or any database, table, or stored procedures, triggers and other elements you add to it, they will be brought from the template database after you create database.
Of course, some people say that you can't delete the two template1 template0 databases, because they are template databases and cannot be deleted.
The above picture is to delete the template database, and then when creating the database,. Failed.
4 pg_hba.conf when setting permissions, as shown in the following figure
For example, let's set up an account.
The minimum guarantee is that when the system logs in on a non-host computer, it needs to provide the verification of the account password. Due to the above pg_hba setting, anyone can log in to the database at any time without using any password.
The security of the database is gone.
(5) when writing CTE, using recursive carries out recursive activities similar to a dead loop, resulting in the final failure of the statement and abnormal consumption of system resources.
Such a statement will result in
1 serious consumption of system resources
2 the crazy use of the TEMP library of the system is likely to cause your temp library to take up a lot of disk space
3 causes the client connection to be KILL
At this point, the study of "what foolish operations PostgreSQL can not do" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.