Watch a table for changes and push a notification with a payload describing the change.
In the Postgres shell:
-- Create the functions
Watch a table for changes and push a notification with a payload describing the change.
In the Postgres shell:
-- Create the functions
import select | |
import datetime | |
import psycopg2 | |
import psycopg2.extensions | |
conn = psycopg2.connect(database="postgres", user="vagrant") | |
#conn.set_isolation_level(psycopg2.extensions.ISOLATION_LEVEL_AUTOCOMMIT) | |
curs = conn.cursor() |
DROP TABLE IF EXISTS test_table; | |
CREATE TABLE test_table( | |
id bigserial NOT NULL, | |
latitude double precision, | |
longitude double precision, | |
geom geometry, | |
geog geography, | |
updated_ts double precision, | |
CONSTRAINT test_table_unique_key UNIQUE (id) | |
); |
create schema shard_1; | |
create sequence shard_1.global_id_sequence; | |
CREATE OR REPLACE FUNCTION shard_1.id_generator(OUT result bigint) AS $$ | |
DECLARE | |
our_epoch bigint := 1314220021721; | |
seq_id bigint; | |
now_millis bigint; | |
-- the id of this DB shard, must be set for each | |
-- schema shard you have - you could pass this as a parameter too |
To create a database, you need to first ensure that the database's role exists first. Role and User are synonymous
in PostgreSQL. Once you create the ROLE
, you can create the Database and set the OWNER
as the ROLE
.
Create Role
brew install python3 | |
pip install argparse (optional) | |
pip install virtualenv | |
mkdir <your_fancy_project> | |
cd <your_fancy_project> | |
mkdir <your_fancy_repo> | |
virtualenv -p /usr/local/bin/python3 env | |
source env/bin/activate | |
source activate | |
*source deactivate |
# Create directories | |
mkdir c:\mongo\db | |
mkdir c:\mongo\config | |
mkdir c:\mongo\log | |
# Create a configuration file | |
# in c:\mongo\config\ as | |
# 'mongod.cfg' and paste: | |
#|==================================| | |
#| logpath=C:\mongo\log\mongodb.log | |
Key/Command | Description |
---|---|
Tab | Auto-complete files and folder names |
Ctrl + A | Go to the beginning of the line you are currently typing on |
Ctrl + E | Go to the end of the line you are currently typing on |
Ctrl + U | Clear the line before the cursor |
Ctrl + K | Clear the line after the cursor |
Ctrl + W | Delete the word before the cursor |
Ctrl + T | Swap the last two characters before the cursor |
var polygon = ee.Geometry.Polygon([[ | |
[-119.33364769821117, 46.05123532178373], | |
[-119.3233620672313, 45.869732769408905], | |
[-119.04111088542663, 45.873079023065166], | |
[-119.0396574679861, 46.045448840018565] | |
]]); | |
var landsat8 = ee.ImageCollection("LANDSAT/LC8_L1T_TOA_FMASK"); | |
// | |
// Masking Clouds with Fmask |