<div dir="ltr"><span style="font-family:monospace,monospace">Thank you Sergey for the callback library, and thank you Timothy and Adam for reminding me that I need to be worried more about issues such as security, concurrency and transactions!<br><br>This got me thinking... <br><br>I should also clarify that the data will *already be in Posgres*. <br><br>It is originally created via users editing forms on the client side of an Ur/Web app, but then it is stored by the Ur/Web server in the Postgresql database.<br><br>So this data in SQL already satisfies certain transactional requirements and uniqueness properties, due to the concurrency and transaction controls in Postgresql.<br><br>This vastly simplifies my question - and now I see that it is a Postgres question, not an UrWeb question. I just need to get that data from *Postgres* to the filesystem.<br><br>Also, this data is already grouped in a "tree" of recordsets, with a single top table containing a single record at the top each "tree". <br><br>Therefore I can use the primary key of the top table as a *unique* identifier in the filesystem - to name the directory where all the child recordsets will be stored.<br><br>I see there is a COPY command in Postgresql.<br><br><a href="http://www.postgresql.org/docs/9.4/static/sql-copy.html">http://www.postgresql.org/docs/9.4/static/sql-copy.html</a><br><br>And if I need to create directories from Postgresl, I found 2 forum links explaining how to do this. (Interesting how the responses in these threads also heavily emphasized the security aspect.)<br><br><a href="http://forums.devshed.com/postgresql-help-21/call-os-command-postgresql-function-216709.html">http://forums.devshed.com/postgresql-help-21/call-os-command-postgresql-function-216709.html</a><br><br><a href="http://postgresql.nabble.com/Runnning-operating-system-commands-from-an-SPL-td2142302.html">http://postgresql.nabble.com/Runnning-operating-system-commands-from-an-SPL-td2142302.html</a><br><br>Again, I'm thankful for people emphasizing the issues involving security and concurrency and transactions! <br><br>I'd certainly much rather rely on the existing facilities for this in Postgres rather than having to do it through C - even more so, via a foreign-function interface.<br><br>And it's very interesting to now view Postgresql as the transactional "gateway" to the underlying filesystem...<br><br>###<br></span></div>