Home postgresql How to Clear Table from PostgreSQL

How to Clear Table from PostgreSQL

Author

Date

Category

How to Clean the House Table from all values. The columns themselves leave, you need to remove the contents. Made such an option, but I need not in one column, but for all. Try to replace “column” on “*”?

update "house" set "column" = null

Answer 1, Authority 100%

Team Delete Deletes from the specified table Rows satisfying the condition Where . If the WHERE proposal is missing, it removes all the rows from the table, as a result work will be obtained, but an empty table.

delete from house;

Team Truncate Quickly deletes all lines From the set of tables. It acts the same way as the unconditional Delete command for each table, but much faster, as it actually does not scan the tables. Moreover, it immediately releases disk space, so it is not required to perform the Vacuum operation. It is most useful for large tables.

truncate house;

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions