Can we simulate Oracle Flashback with pg_export_snapshot()?

From: William Dunn <dunnwjr(at)gmail(dot)com>
To: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Can we simulate Oracle Flashback with pg_export_snapshot()?
Date: 2015-05-20 15:59:09
Message-ID: CAEva=VnvJ-cAQqmgv2U=Lf9m+4SC=E9BCa76EZ6Cz7N_ezphCg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

Just had an idea and could use some feedback. If we start a transaction,
leave it idle, and use pg_export_snapshot() to get its snapshot_id MVCC
will hold all the tuples as of that transaction's start and any other
transaction can see the state of the database as of that time using SET
TRANSACTION SNAPSHOT snapshot_id?

http://www.postgresql.org/docs/devel/static/functions-admin.html#FUNCTIONS-SNAPSHOT-SYNCHRONIZATION

I'm thinking of setting up automation to ~every half hour open a
transaction as such, close any that have been open over an hour, and store
the snapshot_id. However, I don't have a busy system that I can test it on.

Of course this would cause some extra bloat because those tuples cannot get
autovacuumed until the transaction closes but that is also the case in
Oracle. Is there anything else I am missing or a reason that this would not
be possible?

Thanks!

*Will J. Dunn*
*willjdunn.com <http://willjdunn.com>*

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Nolan 2015-05-20 16:24:50 Consistent state for pg_dump and pg_dumpall
Previous Message Steve Midgley 2015-05-20 15:43:50 Re: [GENERAL] Does PG support bulk operation in embedded C