On Fri, Jul 3, 2020 at 7:46 PM Ron <ronljohnsonjr@xxxxxxxxx> wrote: > > On 7/3/20 1:54 AM, Laurenz Albe wrote: > > This is my favorite example why I like the way PostgreSQL does things: > > > > /* poor man's VACUUM (FULL) */ > > BEGIN; > > CREATTE TABLE t2 AS SELECT * FROM t1; > > DROP TABLE t1; > > ALTER TABLE t2 RENAME TO t1; > > COMMIT; > > How so, since it does not carry over indexes, foreign keys, triggers, > partition references, etc? The point of this example is that if you have a typo in the CREATE TABLE like here, you *don't want* to continue executing the commands, which would drop the original table while you don't have a copy of the data anymore. That's what he meant by liking the way postgres does things, not how to do this poor man's vacuum full.