Skip to content

Instantly share code, notes, and snippets.

@scaint
Last active February 9, 2016 17:02
Show Gist options
  • Save scaint/c0dbdcaf930db67245b4 to your computer and use it in GitHub Desktop.
Save scaint/c0dbdcaf930db67245b4 to your computer and use it in GitHub Desktop.
CREATE OR REPLACE FUNCTION public.NOW() RETURNS timestamp AS 'SELECT timestamp ''2016-01-01''' LANGUAGE SQL IMMUTABLE;
SELECT NOW();
BEGIN;
SET LOCAL search_path TO public,pg_catalog;
SELECT NOW();
COMMIT;
SELECT NOW();
DROP FUNCTION public.NOW();
CREATE FUNCTION
now
-------------------------------
2016-02-09 18:50:13.284655+02
(1 row)
BEGIN
SET
now
---------------------
2016-01-01 00:00:00
(1 row)
COMMIT
now
-------------------------------
2016-02-09 18:50:13.285317+02
(1 row)
DROP FUNCTION
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment