Re: survey: psql syntax errors abort my transactions

From: Julien Rouhaud <rjuju123(at)gmail(dot)com>
To: Ron <ronljohnsonjr(at)gmail(dot)com>
Cc: "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: survey: psql syntax errors abort my transactions
Date: 2020-07-03 18:41:04
Message-ID: CAOBaU_ZUj3JFNcPTY7_HhQhtnzAQj6xdE2SmGpCUpEhXdEQpmw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Jul 3, 2020 at 7:46 PM Ron <ronljohnsonjr(at)gmail(dot)com> 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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Mohamed Wael Khobalatte 2020-07-03 20:24:10 Degraded performance during table rewrite
Previous Message Ron 2020-07-03 17:46:09 Re: survey: psql syntax errors abort my transactions