Here are some examples on Pg::Snapshots usage:

Summary
-------
1-Complete Refresh
1.1-PostgreSQL <-> PostgreSQL (Local)
1.2-PostgreSQL <-> PostgreSQL (Remote)
1.3-PostgreSQL <-> Oracle
1.4-PostgreSQL <-> ODBC
1.5-PostgreSQL <-> Sybase
1.6-PostgreSQL <-> MySQL
1.7-PostgreSQL <-> Firebird
2-Fast Refresh
2.1-PostgreSQL <-> PostgreSQL (Local)
2.2-PostgreSQL <-> PostgreSQL (Remote)
2.3-PostgreSQL <-> Oracle


1-Complete Refresh

-------------------------------------------------------------------------
1.1-PostgreSQL <-> PostgreSQL (Local)

CREATE TABLE public.test_table (
pk int,
name varchar,
address varchar,
constraint test_table_pk primary key (pk));

INSERT INTO public.test_table VALUES (1, 'albert', '101 Wall Street');
INSERT INTO public.test_table VALUES (2, 'rachel', '1021 10th Street');
INSERT INTO public.test_table VALUES (3, 'chris', '220 20th Street');
INSERT INTO public.test_table VALUES (4, 'joe', '501 Rosewell Street');
INSERT INTO public.test_table VALUES (5, 'john', '321 Lake Street');
INSERT INTO public.test_table VALUES (6, 'linda', '212 Cuba Street');
INSERT INTO public.test_table VALUES (7, 'megan', '56 1st Street');
INSERT INTO public.test_table VALUES (8, 'sarah', '88 Dodgers Street');
INSERT INTO public.test_table VALUES (9, 'anthony', '99 Daemon Av');

select create_snapshot('public', 'test_table_snapshot', 'select * from public.test_table where name ilike ''a%''', null, 'complete', null);
select refresh_snapshot('public', 'test_table_snapshot');
select * from test_table_snapshot;
Result:
 pk |  name   |     address
----+---------+-----------------
  1 | albert  | 101 Wall Street
  9 | anthony | 99 Daemon Av

-------------------------------------------------------------------------
1.2-PostgreSQL <-> PostgreSQL (Remote)

-------------------------------------------------------------------------
1.3-PostgreSQL <-> Oracle
connect scott/tiger@DB

CREATE TABLE test_table (
pk number(8),
name varchar2(100),
address varchar(100),
constraint test_table_pk primary key (pk));

INSERT INTO test_table VALUES (1, 'albert', '101 Wall Street');
INSERT INTO test_table VALUES (2, 'rachel', '1021 10th Street');
INSERT INTO test_table VALUES (3, 'chris', '220 20th Street');
INSERT INTO test_table VALUES (4, 'joe', '501 Rosewell Street');
INSERT INTO test_table VALUES (5, 'john', '321 Lake Street');
INSERT INTO test_table VALUES (6, 'linda', '212 Cuba Street');
INSERT INTO test_table VALUES (7, 'megan', '56 1st Street');
INSERT INTO test_table VALUES (8, 'sarah', '88 Dodgers Street');
INSERT INTO test_table VALUES (9, 'anthony', '99 Daemon Av');

select create_dblink('my_oracle_link', 'dbi:Oracle:DB', 'scott', 'tiger', '');
select create_snapshot('public', 'test_table_snapshot', 'select * from scott.test_table where name like ''a%''', 'my_oracle_link', 'complete', null);
select refresh_snapshot('public', 'test_table_snapshot');
select * from test_table_snapshot;
Result:
 pk |  name   |     address
----+---------+-----------------
  1 | albert  | 101 Wall Street
  9 | anthony | 99 Daemon Av

-------------------------------------------------------------------------
1.4-PostgreSQL <-> ODBC

-------------------------------------------------------------------------
1.5-PostgreSQL <-> Sybase

-------------------------------------------------------------------------
1.6-PostgreSQL <-> MySQL

-------------------------------------------------------------------------
1.7-PostgreSQL <-> Firebird


2-Fast Refresh

-------------------------------------------------------------------------
2.1-PostgreSQL <-> PostgreSQL (Local)

-------------------------------------------------------------------------
2.2-PostgreSQL <-> PostgreSQL (Remote)

-------------------------------------------------------------------------
2.3-PostgreSQL <-> Oracle

-------------------------------------------------------------------------
