Tag Info

New answers tagged


Your representation is simply a way to store a graph. You can use a WITH RECURSIVE clause to follow links between nodes. PostgreSQL documentation (actually first answer to "with recursive sql" by google) show a few examples.


This is addressed in the Migrations overview of the Django documentation. You can remove obsolete references after squashing migrations.


It really depends on how you plan to use this later. You are anyway one migration (and some code changes ofc) from changing this solution from one to the other. So I would choose whatever, and later benchmark it in a way your users really use the system. Even better - profile the app and look for bottlenecks first, instead of optimizing it prematurely. ...


a) Your script looks good to me. You want to just add authentication in this script, so only that user can access the key & certificate. Also some minor changes. Please change your key, do not post your actual key on forum or any type of websites. CREATE MASTER KEY ENCRYPTION BY PASSWORD = '23987hxJKL#1946kcj$n44ncjhdlj' CREATE CERTIFICATE ...


One of the approaches is versioning. You'd design your content table with version and active column. Every time you auto-save you bump the version but don't mark row as active. Once you hit Save you will bump version and publish the content. Gives you complete history at the cost of big tables. I think WordPress uses the same approach.


I consider re writing my objects generating tool to share a single connection between all operations Your current code works, and if it works fast enough, why do you want to fix something which is not broken? Only if some code of yours has some noteable or measurable performance problems, and you know opening and closing the connections too often is ...


You should, although it is likely already being done for you In database operations, a large part of the cost associated with the operation is setting up the connection, doing proper authentication, and so on. It makes a lot of sense to not have a new connection for every operation but simply re-use existing connections. This is a pattern called connection ...


100 % of the world has lost data at some point and when this happens it can essentially isolate the FK based table. DB guys will promise you this can never happen and tout all sorts of recovery capabilities and backing up and logging concepts but it happens. I would say it's a fair shot 50/50 in my experience of enterprise systems either changing business ...

Top 50 recent answers are included