Re: survey: psql syntax errors abort my transactions
| От | Julien Rouhaud |
|---|---|
| Тема | Re: survey: psql syntax errors abort my transactions |
| Дата | |
| Msg-id | CAOBaU_ZUj3JFNcPTY7_HhQhtnzAQj6xdE2SmGpCUpEhXdEQpmw@mail.gmail.com обсуждение исходный текст |
| Ответ на | Re: survey: psql syntax errors abort my transactions (Ron <ronljohnsonjr@gmail.com>) |
| Список | pgsql-general |
On Fri, Jul 3, 2020 at 7:46 PM Ron <ronljohnsonjr@gmail.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.
В списке pgsql-general по дате отправления: