Spatial Analysis in 2025: Key Trends Report
| Download Now
CARTO
Platform
Overview
Visualization
Analytics
App Development
Data Enrichment
AI Agents
Enterprise & Security
Pricing
CARTO for
Google Cloud
AWS
Azure
Snowflake
Databricks
Oracle
Solutions
By Industry
By Use Case
By Role
Telecoms
Icon/indus/Insurance-menu
Icon/indus/Insurance-menu-mobile
Insurance
Logistics
Real Estate
Financial Services
Retail
Marketing & Advertising
Mobility
All industries
Network Deployment
Catastrophe Modeling
Fraud Detection
Market Analysis
Environmental Management
Site Selection
Geomarketing
Data Monetization
IoT Analytics
Supply Chain Optimization
Healthcare Analytics
Territory Planning
All use cases
Data Analyst
Data Scientist
GIS Professional
Developer
Customers
Resources
Learn
Documentation
CARTO Academy
Blog
Reports
Glossary
Connect
Events
Partners
Webinars
Log inRequest a demo
Try for free
2050-01-01
1990-01-01
"ES", "GB"

This content applies to a previous version of CARTO

In October 2021 we released a new version of our platform. You can find the latest documentation at docs.carto.com

Back to Help Center

How to Change Sync Table Data with SQL

Learn how to sync datasets using Import API and PostgreSQL stored procedures.

If you need to change sync table data via a PostgreSQL query, it’s not recommended to leave the query applied in the sync table’s SQL panel. This is because sync tables are completely overwritten at each sync, so it is not guaranteed that the query would automatically apply. Instead you can change the synced data with a trigger function.

The recommended workflow

  1. Create a sync table via the CARTO interface or the Import API, setting it to sync at a certain interval.

  2. Save a stored procedure in your CARTO account that contains the queries you need to run on the dataset after it syncs.

  3. Use an external component to schedule a task that calls your stored procedure. This external component can be a cron task on a client server, an AWS Lambda function, or any other service that allows you to run a simple script. There is no way to determine the exact timestamp at which CARTO will run the sync process, so the recommendation is that the task interval be half or a third of the sync interval. For example, if a sync table updates every x hours, the stored procedure should be called every x/2 or x/3 hours.

CARTO
carto-logo
  • Platform

  • Overview

  • Visualization

  • Analytics

  • App Development

  • Data Enrichment

  • Security & Governance

  • Gen AI

  • Pricing

  • Solutions

  • Data Analyst

  • Developer

  • Data Scientist

  • GIS Professional

  • By Industry

  • By Use Case

  • Resources

  • Customer Stories

  • Blog

  • Glossary

  • Documentation

  • Academy

  • Reports

  • Events

  • Webinars

  • Partners

  • Company

  • About us

  • Newsroom

  • Careers

  • Brand

  • Grants

Unlock the power of spatial analysis.

youtube logofacebook logotwitter logolinkedin logo

© CARTO 2024

Terms

Privacy Notice

Whistleblower Form