-
Notifications
You must be signed in to change notification settings - Fork 651
CartoDB user table
Javier de la Torre edited this page Aug 16, 2013
·
10 revisions
A "cartodb" user table is a table with a well-known set of fields and a well-known set of triggers attached on.
The fields are:
- cartodb_id, a numerical primary key of serial type
- created_at, timestamp with timezone not null default now()
- updated_at, timestamp with timezone not null default now()
- the_geom, geometry, GiST indexed
- the_geom_webmercator, geometry, GiST indexed
- right now CartoDB accepts mixed geometry types on a table. But only these 3 types are accepted: POINT, MULTILINE, MULTIPOLYGON.
- Geometries on CartoDB have only 2 dimensions.
The triggers are (can change in the future):
- DEPRECATED: cache_checkpoint before modifying statement invalidates varnish (wrong to be before?). I dont think we need this as the trigger will be fired from cdb_tablemetadata.
- track_updates after modifying statement updates cdb_tablemetadata
- test_quota before changing statement to forbid if overquota
- test_quota_per_row before changing row to forbod if overquota (checked on a probabilistic basis)
- update_the_geom_webmercator before insert or update row to maintain the_geom_webmercator
- update_updated_at_trigger before update row to maintain updated_at