-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #442 from diffix/piotr/elm-to-master
Merge Elm into master
- Loading branch information
Showing
3 changed files
with
98 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
LOAD 'pg_diffix'; | ||
CREATE TABLE test_datetime ( | ||
id INTEGER, | ||
d DATE, | ||
t TIME, | ||
ts TIMESTAMP WITHOUT TIME ZONE, | ||
tz TIMESTAMP WITH TIME ZONE, | ||
i INTERVAL | ||
); | ||
INSERT INTO test_datetime VALUES | ||
(1, '2012-05-14', '14:59', '2012-05-14', '2012-05-14', '1 years'), | ||
(2, '2012-05-14', '14:59', '2012-05-14', '2012-05-14', '1 years'), | ||
(3, '2012-05-14', '14:59', '2012-05-14', '2012-05-14', '1 years'), | ||
(4, '2012-05-14', '14:59', '2012-05-14', '2012-05-14', '1 years'), | ||
(5, '2012-05-14', '14:59', '2012-05-14', '2012-05-14', '1 years'), | ||
(6, '2012-05-14', '14:59', '2012-05-14', '2012-05-14', '1 years'), | ||
(7, '2012-05-14', '14:59', '2012-05-14', '2012-05-14', '1 years'); | ||
CALL diffix.mark_personal('test_datetime', 'id'); | ||
SET ROLE diffix_test; | ||
SET pg_diffix.session_access_level = 'anonymized_trusted'; | ||
---------------------------------------------------------------- | ||
-- Sanity checks | ||
---------------------------------------------------------------- | ||
SELECT diffix.access_level(); | ||
access_level | ||
-------------------- | ||
anonymized_trusted | ||
(1 row) | ||
|
||
---------------------------------------------------------------- | ||
-- Seeding | ||
---------------------------------------------------------------- | ||
-- Datetime values are seeded the same regardless of global `datestyle` setting | ||
SET datestyle = 'SQL'; | ||
SELECT ts, count(*) FROM test_datetime GROUP BY 1; | ||
ts | count | ||
---------------------+------- | ||
05/14/2012 00:00:00 | 9 | ||
(1 row) | ||
|
||
SET datestyle = 'ISO'; | ||
SELECT ts, count(*) FROM test_datetime GROUP BY 1; | ||
ts | count | ||
---------------------+------- | ||
2012-05-14 00:00:00 | 9 | ||
(1 row) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
LOAD 'pg_diffix'; | ||
|
||
CREATE TABLE test_datetime ( | ||
id INTEGER, | ||
d DATE, | ||
t TIME, | ||
ts TIMESTAMP WITHOUT TIME ZONE, | ||
tz TIMESTAMP WITH TIME ZONE, | ||
i INTERVAL | ||
); | ||
|
||
INSERT INTO test_datetime VALUES | ||
(1, '2012-05-14', '14:59', '2012-05-14', '2012-05-14', '1 years'), | ||
(2, '2012-05-14', '14:59', '2012-05-14', '2012-05-14', '1 years'), | ||
(3, '2012-05-14', '14:59', '2012-05-14', '2012-05-14', '1 years'), | ||
(4, '2012-05-14', '14:59', '2012-05-14', '2012-05-14', '1 years'), | ||
(5, '2012-05-14', '14:59', '2012-05-14', '2012-05-14', '1 years'), | ||
(6, '2012-05-14', '14:59', '2012-05-14', '2012-05-14', '1 years'), | ||
(7, '2012-05-14', '14:59', '2012-05-14', '2012-05-14', '1 years'); | ||
|
||
CALL diffix.mark_personal('test_datetime', 'id'); | ||
|
||
SET ROLE diffix_test; | ||
SET pg_diffix.session_access_level = 'anonymized_trusted'; | ||
|
||
---------------------------------------------------------------- | ||
-- Sanity checks | ||
---------------------------------------------------------------- | ||
|
||
SELECT diffix.access_level(); | ||
|
||
---------------------------------------------------------------- | ||
-- Seeding | ||
---------------------------------------------------------------- | ||
|
||
-- Datetime values are seeded the same regardless of global `datestyle` setting | ||
SET datestyle = 'SQL'; | ||
SELECT ts, count(*) FROM test_datetime GROUP BY 1; | ||
SET datestyle = 'ISO'; | ||
SELECT ts, count(*) FROM test_datetime GROUP BY 1; |