On 07/08/2015 06:49 AM, Stephen Paul Weber wrote: >> Go in order by id, starting with id=1 (which has a created_ts already), >> and check if a row has a created_ts; if null, enter something just a bit >> later (I say 2 minutes) than the *previous* id. > > I don't *think* this can be done in pure SQL, will need a helper script > (whether Haskell, Ruby, pgpl, or whatever) I expect. > > Why not just set all NULL to the same time and be done with it?
It might be easy enough to just go through this manually rather than write a script. A tad tedious but not too bad… I don't want to set to the same time because there are chunks of missing timestamps over an 20 month period, and we'd like to show when a user joined, and it's not hard to estimate that u/229 joined in June 2014 while u/2 joined November 2012. It might take me just 5 minutes to manually update the missing timestamps with estimates that are at least reasonable given the times we do have. I should probably just do that, and then I'd just need to know the command to export the timestamps in a smooth form so that Bryan can use them to update the production DB… -- Aaron Wolf Snowdrift.coop <https://snowdrift.coop> _______________________________________________ Dev mailing list Dev@lists.snowdrift.coop https://lists.snowdrift.coop/mailman/listinfo/dev