succeeded status. As a result, you can create a changefeed with initial_scan = 'only' to data out of your database.
You can also schedule a changefeed that is emitting messages to a downstream sink, which allows you to use a changefeed initial scan for exporting data on a regular cadence.
The benefits of using changefeeds for this use case instead of , include:
- Changefeeds are jobs, which can be , , , , and .
- There is observability into a changefeed job using and the in the DB Console.
- Changefeed jobs have built-in and .
- provide additional endpoints for your data.
- You can use the option with
initial_scan= 'only'to emit messages in CSV format.
EXPORT statement.
Message formats
By default, changefeeds emit messages in JSON format. You can use a different format by with the option and specifying one of the following:jsoncsvavroparquet
Examples
Export data with a changefeed
To create a changefeed that will only complete an initial scan of a table(s), run the following:SHOW CHANGEFEED JOBS to check on the status:
succeeded in the status field.
Create a scheduled changefeed to export filtered data
This example creates a nightly export of some filtered table data with a that will run just after midnight every night. The changefeed uses to query the table and filter the data it will send to the sink:- If it runs into a failure,
on_execution_failure=retrywill ensure that the schedule retries the changefeed immediately. - If the previous scheduled changefeed is still running,
on_previous_running=startwill start a new changefeed at the defined cadence.

