cant' delete branch that is using lots of storage
I have a main/primary branch which we use but it seems to be the child of an old branch. There doesnt seem to be anyway to delete the old branch which we no longer need and is quite expensive given it is 50GB.
Looked through all the options and there does not seem to be a way to detach and then delete.

4 Replies
stormy-gold•2y ago
Hey, the "old" branch is kept as a backup in case your restore option did not go as expected. We currently don't support removing it (it is in fact a parent of your current main branch). We'll be addressing this in a future release.
If you don't need the "old" branch as a backup and you want to remove the data to reduce storage, you can add a compute endpoint to it from the branch page. The compute endpoint will enable you to connect to it like any other branch. Once connected, you can drop data (e.g. DROP TABLE). You can connect via psql or the SQL Editor in the console, for example.

harsh-harlequinOP•2y ago
Thanks @Daniel I have gone and deleted all the data in the old branch
A couple of things:
1) the processes felt very scary because the neon dashboard abritrarily switches between branches when you click on links - like moving between table view and sql editor jumps between branches. This feels like it can defs lead to accidentally deletion or working on wrong branch.
2) The inability to delete a branch make a branch the new master feels weird. I dont understand how I got this new parent branch so I am worried I am going to do it again accidentally and am creating lots of work for myself to delete data. Is the solution to just not use the branching feature till the ability to delete exists?
stormy-gold•2y ago
Regarding point 1. Thanks for that feedback. I'm going to open an Issue for it.
Regarding point 1. A restore creates a child branch, and your old "main" is the parent (renamed). This doc provides some explanation: https://neon.tech/docs/guides/branch-restore#automatic-backups We're working on making it possible to remove parent branches in this scenario.
Neon
Branch Restore - Neon Docs
With Neon's branch restore capability, you can easily restore a branch to an earlier state in its own or another branch's history. You can use Time Travel Assist to connect to a specific point in your...
rising-crimson•2y ago
Hello @nicok. This means with every Restore I loose one of my available branches?!?
Is there a rough release schedule for being able to delete "old" branches (or resetting the parent branch to make the old branch deletable)? If you can't give a rough estimation in date and time at maybe you can give at least one in form of priority...