Re:PostgreSQL tips and tricks
by avar on Sunday May 29, 2011 @05:26PM
(#2597645)
Doesn't PostgreSQL support something like:
Which is the common pattern of atomically swapping out tables in MySQL with zero downtime.
[ Parent
| on HN ]
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.