How to replace whole table
I need to create database that should represent currently available torrents on torrent tracker and update it completely every day or so, replacing previously saved data and erasing records about those torrents which were deleted from the site.
How can I do it? If I just collect new data in the temporary table and then try to do
DROP TABLE and rename temporary table to the main table's name, I'll make other resources which also use this DB unable to do their work for some period of time. Or this is the best way to do it anyway and I should just do these operations in one transaction?
I'm going to use MySQL or PostgreSQL, but I can change this idea to the one you'll give me reasonable.
truncate table followed by insert statement(s). https://dev.mysql.com/doc/refman/5.6/en/truncate-table.html
- A Linux, Apache, MySQL, PHP (LAMP) stack is a combination of open source software that is typically installed together to enable a server to host dynamic […]
- MySQL is an the most popular open-source database management system, in most of hosting company its has been bundle by LAMP(Linux, Apache, MySQL, PHP/Python/Perl) stack. Another alternative […]
- MySQL is the world’s most popular open-source database. Despite its powerful features, MySQL is simple to set up and easy to use. Below are some instructions […]