Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Doesn't PostgreSQL support something like:

    RENAME TABLE current TO current_old,
                 current_new TO current;
Which is the common pattern of atomically swapping out tables in MySQL with zero downtime.


Almost all DDL is transactional in PostgreSQL, so the usual equivalent to the above would be:

  begin;
  alter table current rename to current_old;
  alter table current_new rename to current;
  commit;
Transaction-safe DDL is a very handy thing indeed.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: