RE: Implement UNLOGGED clause for COPY FROM

From: "tsunakawa(dot)takay(at)fujitsu(dot)com" <tsunakawa(dot)takay(at)fujitsu(dot)com>
To: 'Peter Smith' <smithpb2250(at)gmail(dot)com>
Cc: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Masahiko Sawada <masahiko(dot)sawada(at)2ndquadrant(dot)com>, "osumi(dot)takamichi(at)fujitsu(dot)com" <osumi(dot)takamichi(at)fujitsu(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: RE: Implement UNLOGGED clause for COPY FROM
Date: 2020-09-11 05:15:32
Message-ID: TYAPR01MB2990ED6B394A9B4B51D28569FE240@TYAPR01MB2990.jpnprd01.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

From: Peter Smith <smithpb2250(at)gmail(dot)com>
On Thu, Sep 10, 2020 at 7:16 PM tsunakawa(dot)takay(at)fujitsu(dot)com
> <tsunakawa(dot)takay(at)fujitsu(dot)com> wrote:
> > ALTER TABLE takes long time proportional to the amount of existing data,
> while wal_level = none doesn't.
>
> Right, but if wal_level=none is considered OK for that table with
> existing data, then why not just create the table UNLOGGED in the
> first place? (or ALTER it to set UNLOGGED just one time and then leave
> it as UNLOGGED).

The target tables sometimes receive updates (for data maintenance and/or correction). They don't want those updates to be lost due to the database server crash. Unlogged tables lose their entire contents during crash recovery.

Please think like this: logging is is the norm, and unlogged operations are exceptions/hacks for some requirement of which the user wants to minimize the use.

Regards
Takayuki Tsunakawa

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Hunter, James 2020-09-11 05:32:13 Re: Fix for parallel BTree initialization bug
Previous Message Fujii Masao 2020-09-11 04:48:49 Re: New statistics for tuning WAL buffer size