This file contains hidden or 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<!--Edit the title of the page--> | |
<title>CartoDB Point Clustering</title> | |
<meta name="description" content=""> | |
<meta name="author" content=""> | |
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> | |
<link rel="stylesheet" href="http://libs.cartocdn.com/cartodb.js/v3/themes/css/cartodb.css" /> |
This file contains hidden or 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
-- | |
-- Change ID of any revision having revision_time at a later time than | |
-- any other revision with higher ID | |
-- | |
-- New IDs for revisions to be moved will be assigned in | |
-- revision_time order and start after the highest existing | |
-- revision ID. | |
-- | |
-- The number of moved revisions is returned. | |
-- |
This file contains hidden or 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
CREATE EXTENSION table_version; | |
CREATE TABLE IF NOT EXISTS t (k int primary key, v text); | |
SELECT table_version.ver_enable_versioning('public','t'); | |
SELECT table_version.ver_create_revision('r1'); -- 1001 (empty) | |
SELECT table_version.ver_complete_revision(); | |
SELECT table_version.ver_create_revision('r2'); -- 1002 | |
INSERT INTO t VALUES (1, 'a'); | |
INSERT INTO t VALUES (2, 'b'); | |
INSERT INTO t VALUES (3, 'c'); |
This file contains hidden or 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
DROP FUNCTION IF EXISTS table_version.ver_unknown_revisions(); | |
CREATE OR REPLACE FUNCTION table_version.ver_unknown_revisions() | |
RETURNS TABLE (tab TEXT, rev INT) AS | |
$$ | |
DECLARE | |
v_rec RECORD; | |
BEGIN | |
DROP TABLE IF EXISTS tmp_ids; | |
CREATE TEMP TABLE tmp_ids(t text, r int); |
OlderNewer