"osumi.takamichi@fujitsu.com" <osumi.takamichi@fujitsu.com> writes:
>> Aside from that, though, how does this improve upon the existing capability to copy into an unlogged temporary
table?
> [>] unlogged temporary table can’t be inherited over sessions first of all.
Unlogged tables don't have to be temporary.
> And unlogged table needs to be recreated due to startup truncation of the table’s content
> when the server crashes.
Indeed, and your proposed feature would extend that un-safety to tables
that are NOT marked unlogged, which is not good.
AFAICS, we can already accomplish basically the same thing as what you
want to do like this:
alter table foo set unlogged;
copy foo from ...;
alter table foo set logged;
The mechanics of that are already well worked out. It's expensive,
no doubt about that, but I think you're just fooling yourself to
imagine that any shortcuts are possible. A mix of unlogged and logged
data is never going to work safely.
> To achieve this, we have to
> consider a new idea like loaded data’d be added
> at the end of the all other pages and detach those
> if the server crashes during the UNLOGGED loading processing for example.
You keep on ignoring the indexes... not to mention replication.
regards, tom lane