BEGIN;

CREATE TABLE tstest(
	id int,
	tswithout timestamp without time zone,
	tswith timestamptz
);

SET timezone = 'America/New_York';

PREPARE ewithout (int, timestamp without time zone, timestamp without time zone)
	AS INSERT INTO tstest (id, tswithout, tswith) VALUES ($1, $2, $3);
PREPARE ewith (int, timestamp with time zone, timestamp with time zone)
	AS INSERT INTO tstest (id, tswithout, tswith) VALUES ($1, $2, $3);
PREPARE eunk (int, unknown, unknown)
	AS INSERT INTO tstest (id, tswithout, tswith) VALUES ($1, $2, $3);

EXECUTE ewithout (1, '2013-09-09 12:34:56 -0400', '2013-09-09 12:34:56 -0400');
EXECUTE ewith (2, '2013-09-09 12:34:56 -0400', '2013-09-09 12:34:56 -0400');
EXECUTE eunk (3, '2013-09-09 12:34:56 -0400', '2013-09-09 12:34:56 -0400');
EXECUTE ewithout (4, '2013-09-09 12:34:56', '2013-09-09 12:34:56');
EXECUTE ewith (5, '2013-09-09 12:34:56', '2013-09-09 12:34:56');
EXECUTE eunk (6, '2013-09-09 12:34:56', '2013-09-09 12:34:56');
SELECT * FROM tstest;
DELETE FROM tstest;

SET timezone = 'America/Los_Angeles';

EXECUTE ewithout (7, '2013-09-09 12:34:56 -0400', '2013-09-09 12:34:56 -0400');
EXECUTE ewith (8, '2013-09-09 12:34:56 -0400', '2013-09-09 12:34:56 -0400');
EXECUTE eunk (9, '2013-09-09 12:34:56 -0400', '2013-09-09 12:34:56 -0400');
EXECUTE ewithout (10, '2013-09-09 12:34:56', '2013-09-09 12:34:56');
EXECUTE ewith (11, '2013-09-09 12:34:56', '2013-09-09 12:34:56');
EXECUTE eunk (12, '2013-09-09 12:34:56', '2013-09-09 12:34:56');

SET timezone = 'America/New_York';

SELECT * FROM tstest;

ROLLBACK;

