I have a table in CartoDB 'inland' that I would like to have automatically update each day at 8pm PST. I know that PostgreSQL has no internal function to run an UPDATE COLUMN function at a certain time of day. Is there a way to use Cron or PgAgent to do this? Would I need to setup CartoDB on my local machine instead of only using the webservice?
1 Answer
Have you considered setting up an UPDATE sql query through a URL such as:
http://{account}.cartodb.com/api/v2/sql?q=UPDATE INTO test_table (column_name) VALUES ('value')&api_key={Your API key}
and then setting up a schedule timer to visit that URL at a specific time of day?
-
I have not considered doing that as I didn't know that was an option. How does that work? Also how would I setup a scheduled timer in my table? It sounds promising though.– cbunnCommented Aug 26, 2014 at 17:31
-
You can find more info on SQL URL queries here link. Basically whenever that URL is visited it will run the query. As far as setting up a timer, it depends on your computer system but I know you can setup a scheduled event in Windows which will tell windows to open the browser and navigate to a specific URL.– DanielCommented Aug 27, 2014 at 2:21