What is a CARTO Dataset?
Throughout all of the CARTO ecosystem you will see the term dataset
used, rather than term table
that CARTO’s backend, PostgreSQL, uses. A dataset
is essentially a table
that has been processed to be used within CARTO.
- You do not know the difference between a Postgres table and a CARTO dataset
- You are confused why your table you made with
CREATE TABLE()
is not in your dashboard
What happens when a table is processed?
Three indexed columns are added to every CARTO dataset:
-
cartodb_id
: primary key of the dataset, it has unique values and it can’t be null. -
the_geom
: field where the geometries (points, lines, or polygons) are stored in the CARTO dataset. The geometries must be in the projection EPSG:4326 (WGS84 - Geodetic coordinate system for World) -
the_geom_webmercator
: this field is hidden in the dataset, and it stores the geometries in the projection EPSG:3857 (WGS84 Web Mercator (Auxiliary Sphere) - Projected coordinate system for World), this field is used to render the geometries on the map. This field is automatically updated when a geometry in the_geom field is added or updated.
There are also triggers added to these tables in order to add new cartodb_id’s and indexes as new rows are added.
When is a table processed?
Tables are automatically registered when you import them through our import API
How do I manually process a table to use in CARTO?
In the event that you have used the postgresql function CREATE TABLE
through CARTO’s SQL API, you will need to use the CARTO function cdb_cartodbfytable()
in order to make it visible in your dashboard, and usable throughout all of CARTO.
SELECT cdb_cartodbfytable({table_name});
Note: If you are an developer using an Enterprise account, you must also include the organization username as part of the request. For example:
SELECT cdb_cartodbfytable({username}, {table_name});
What’s next?
Check out the Developer’s Center for more information about table creation
Learn more about working with databases using CARTO
Learn more about other CARTO functions and about Crankshaft, CARTO’s Spatial Analysis extension for PostgreSQL.