Re: Survey on backing up unlogged tables: help us with PostgreSQL development!

From: Jayadevan M <Jayadevan(dot)Maymala(at)ibsplc(dot)com>
To: Alban Hertroys <dalroi(at)solfertje(dot)student(dot)utwente(dot)nl>
Cc: Andy Colson <andy(at)squeakycode(dot)net>, PostgreSQL general <pgsql-general(at)postgresql(dot)org>, pgsql-general-owner(at)postgresql(dot)org
Subject: Re: Survey on backing up unlogged tables: help us with PostgreSQL development!
Date: 2010-11-19 08:07:44
Message-ID: OF1C6643BB.1F08C996-ON652577E0.002BD21A-652577E0.002CBDE6@ibsplc.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

> > Thank you for the reply. But my doubt was not about layout, rather the

> > DMLs. If I do an insert into an 'unlogged' table, what happens to
that?
> > Will that be replicated in the slave (using PostgreSQL's inbuilt
> > replication)?
>
> What are the use-cases for replicating unlogged tables?
>
I do not have a use case for replicating unlogged tables. But I may use
temp/unlogged tables in my master to populate actual tables.

Say, I have a db archival/purge process. I populate temp tables with PKs
of my permanent tables and use that to drive my insertion into history
tables, deletion from live tables etc.

Pseudocode

Insert into mytemptable (id) tables select mypk from liveable where
lastuseddate < archivedate;

insert into myhist select a.* from livetable a join mytemp table on
a.mypk=mytemptable.id
delete from liveable where mypk in (select id from mytemp )

Reading about what goes into WAL tells me that the permanent table data
will be replicated all right even if the temp tables are not logged. Is
that right?

Regards,
Jayadevan

DISCLAIMER:

"The information in this e-mail and any attachment is intended only for
the person to whom it is addressed and may contain confidential and/or
privileged material. If you have received this e-mail in error, kindly
contact the sender and destroy all copies of the original communication.
IBS makes no warranty, express or implied, nor guarantees the accuracy,
adequacy or completeness of the information contained in this email or any
attachment and is not liable for any errors, defects, omissions, viruses
or for resultant loss or damage, if any, direct or indirect."

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Vangelis Katsikaros 2010-11-19 11:52:27 tablespace restore
Previous Message Marc Mamin 2010-11-19 07:41:00 Re: Survey on backing up unlogged tables: help us with PostgreSQL development!